Big O Gym › Problem

Big O Quiz: Binary Heap Peek

What is the time complexity of peeking at the top (max or min) of a binary heap?

Concept: constant-time access at the heap root

The top element is always at the root, which is index 0 of the underlying array. No traversal, no swaps - a constant-time array read, **O(1)**.

More Big O practice problems · Today's daily problem