The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height 5 are
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2015 Set 1 · Q25
Time
Select one answerSingle correct
Solution
Official answer: A) 63 and 6, respectively
TreesGiven that the height of the tree , where height is defined as the length of the longest root-to-leaf path (number of edges from root to leaf):
Maximum number of nodes: A binary tree attains the maximum number of nodes when it is a full (complete) binary tree where every level is fully populated.
Minimum number of nodes: A binary tree attains the minimum number of nodes when it is skewed (each level has exactly 1 node).
Thus, the maximum and minimum number of nodes are 63 and 6, respectively, which corresponds to option (A).
Try the question first, then check your work.
Examiner trap
Recall that maximum nodes for height occur in a full binary tree () and minimum nodes occur in a skewed binary tree ().
This Trees previous year question is Q25 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on Trees in Programming and Data Structures, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Trees PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Trees has 13 GATE CSE PYQs across 11 papers from 2012 to 2026. 4 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 1.
How GATE tests TreesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.