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
GATE CSE 2015 Set 2 · Q10
Time
Your answerNumerical answer
Solution
Official answer: 19
TreesIn any binary tree, the number of leaf nodes (nodes with degree 0) and the number of internal nodes with degree 2 () are related by the property:
Given :
Thus, the number of nodes in having two children is 19.
Try the question first, then check your work.
Examiner trap
Recall the fundamental property of binary trees relating the number of leaves to the number of nodes having two children: .
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
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. 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 TreesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.