GateAI
Trees

GATE CSE 2015 Set 2 · Q10

NAT1 markEasy

Time

A binary tree T has 20 leaves. The number of nodes in T having two children is ______.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 19

Trees

In any binary tree, the number of leaf nodes LL (nodes with degree 0) and the number of internal nodes with degree 2 (n2n_2) are related by the property:

L=n2+1L = n_2 + 1

Given L=20L = 20:

n2=L−1=20−1=19n_2 = L - 1 = 20 - 1 = 19

Thus, the number of nodes in TT having two children is 19.

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 Q10 of the GATE CSE 2015 Set 2 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. 5 of them are 1-mark NAT questions like this one, and it is the only one in GATE CSE 2015 Set 2.

How GATE tests Trees

More from GATE CSE 2015 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2015 Set 2 · Q10 · NAT

A binary tree T has 20 leaves. The number of nodes in T having two children is …

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.