In a binary max heap containing $n$ numbers, the smallest element can be found in ______
In binary max heaps, smallest element will be present at leaves which resides from $\lceil\frac{n}{2}\rceil$ to $n$ location so we need to traverse at max $\frac{n}{2}$ elements which takes O(n)$
GATE 2006
Hence Option A) is correct
https://www.geeksforgeeks.org/data-structures-and-algorithms-set-7/
In a max heap, the smallest element is always present at a leaf node. So we need to check for all leaf nodes for the minimum value. Worst case complexity will be O(n)
64.3k questions
77.9k answers
244k comments
80.0k users