All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · November 2020

In a binary max heap containing numbers, the smallest element can be found in ____ time.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. O(n)

Explanation

In a max-heap the minimum is one of the ~n/2 leaves, with no order among them, so finding it takes O(n).

More Data Structures and Algorithms questions