GateAI
Trees

GATE CSE 2015 Set 1 · Q25

MCQ1 markEasy

Time

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

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 63 and 6, respectively

Trees

Given that the height of the tree h=5h = 5, where height is defined as the length of the longest root-to-leaf path (number of edges from root to leaf):

  1. 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.

    Nmax⁡=2h+1−1=25+1−1=26−1=64−1=63N_{\max} = 2^{h+1} - 1 = 2^{5+1} - 1 = 2^6 - 1 = 64 - 1 = 63
  2. Minimum number of nodes: A binary tree attains the minimum number of nodes when it is skewed (each level has exactly 1 node).

    Nmin⁡=h+1=5+1=6N_{\min} = h + 1 = 5 + 1 = 6

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.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

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

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Trees in GATE CSE

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 Trees

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q25 · MCQ

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

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.