← Quiz: Heaps and Heap Sort Internals: all 15 questions
Quiz: Heaps and Heap Sort Internals · Question 15 of 15
What is the time to pop the smallest item from a binary heap of n items?
What is the time to pop the smallest item from a binary heap of n items?
- A.O(1)
- B.O(n)
- C.O(log n)
- D.O(n log n)
Answer & explanation
Correct answer: O(log n)
The last item moves to the root and sifts down, at most one level per step, and the height is about log₂ n.
Can you get the rest right without peeking?
Take the timed Quiz: Heaps and Heap Sort Internals quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →