GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 12

Maximum nodes at a given edge height

Data Structures · Tree Properties & Traversals · Full GATE CSE 2007 paper

GATE 2007, Q12 1 mark · MCQ
Report issue

Tree Properties & Traversals

Question 12, GATE 2007: The height of a binary tree is the maximum number of edges on a root-to-leaf path. What is the maximum number of nodes at height h?
Options:
(A) 2^h−1
(B) 2^(h−1)−1
(C) 2^(h+1)−1
(D) 2^(h+1)
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. With edge height, the root is at depth zero. Count all levels including both level zero and level h, rather than counting only h levels.

2. Derivation and interpretation. At depth i a binary tree has at most 2i nodes. For edge height h, depths 0 through h sum to 1+2+...+2h=2h+1−1, C, attained by a perfect binary tree.

Original paper, page 3