Open In App
Related Articles

Algorithms Quiz | Sudo Placement [1.6] | Question 7

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
Time Complexity to find smallest element in Binary Max Heap? (A) O(logN) (B) O(N) (C) O(N * logN) (D) O(1)

Answer: (B)

Explanation: 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) 12 / \ / \ 8 7 / \ / \ / \ / \ 2 3 4 5

Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 16 Aug, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads