Every ancestor of 9 must have a smaller value. Only eight smaller integers exist, so its depth is at most eight. A chain labelled 1 through 9 can occupy depths zero through eight, with remaining positions filled by larger values in heap order. The complete tree is deep enough, so eight is attainable.
More Binary Heaps questions
GATE 2011 CS (CS1) Q33– A max-heap has parent values at least their children’s values. Which displayed tree is a…
GATE 2015 CS (CS2) Q22– A complete binary tree has max-heaps as the left and right subtrees of its root. Which…
GATE 2015 CS (CS3) Q30– Find the minimum number of interchanges needed to convert the level-order array…
GATE 2021 CS (CS2) Q12– A binary min-heap of n elements is stored in an array. Find the worst-case complexity of…
GATE 2026 CS (CS1) Q23– Let n be an odd number greater than 100. Consider a binary minheap with n elements stored…
GATE 2025 CS (CS1) Q35– The height of any rooted tree is defined as the maximum number of edges in the path from…