GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 2.12

Height of a weight-balanced binary tree

Data Structures · Binary Search & Balanced Trees · Full GATE CSE 2002 paper

GATE 2002, Q2.12 2 marks · MCQ
Report issue

Binary Search & Balanced Trees

Question 2.12, GATE 2002: A weight-balanced binary tree is defined so that, at every node, the left subtree’s node count is at least half and at most twice the right subtree’s count. Which expression best describes its maximum possible height with n nodes, counting nodes along the root-to-farthest-leaf path?
(A) log₂ n; (B) log₂⁄₃ n; (C) log₃ n; (D) log₃⁄₂ n.
Tap to enlarge
Your answer
Answer & solution

Answer: D as the standard growth-bound expression (no official key was published)

Step 1: Use the heavier child on a deepest path.

Step 2: If child sizes are a≥b, the weight constraint gives a≤2b. Since a+b=n−1, this implies a≤2(n−1)/3. Repeating the inequality along a path yields geometric shrinkage and a logarithmic height. Integer rounding prevents the option from being an exact height formula; its role is to express the extremal shrinkage factor rather than a literal answer for every small n.

Conclusion: A child subtree contains at most 2(n−1)/3 nodes. Following a deepest branch therefore shrinks the remaining size by at least a constant factor 3/2, yielding height at most log3/2n+O(1). Maximally skewed admissible weight splits attain the same leading logarithmic growth, so D is the conventional expression. The displayed logarithm is a growth bound, not an exact integer height for every n; rounding and admissible tree sizes matter.

Original paper, page 5