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

The number of nodes of height h in any n-element heap is at most

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

Show answer & explanation

Correct answer: A. ⌈n / 2h+1⌉

Explanation

CLRS: an n-element heap has at most ⌈n / 2h+1⌉ nodes of height h; for example, about n/2 leaves at h = 0.

More Data Structures and Algorithms questions