Question DSA-HEAP-0005
EasyWhat is the time complexity of finding (peeking at) the minimum in a min-heap?
- A.
O(log n)
- B.
O(n log n)
- C.
O(n)
- D.
O(1)
Show answer and explanation
Answer: D
In a min-heap every parent is ≤ its children, so the minimum is always the root, read in O(1).