Query on data structures


The time complexity for finding the smallest number among n elements in binary max heap is


O(n) since it can be present in any leaf node so you have to traverse the whole tree.


Yes it’s correct.The answer is O(n) and the reason is also true