GATE / CS ARCHIVE

GATE CSE 2026 SET 1 / QUESTION 33

Maximum height of a full binary tree

Data Structures · Tree Properties & Traversals · Full GATE CSE 2026 Set 1 paper

GATE 2026 Set 1, Q33 1 mark · NAT
Report issue

Tree Properties & Traversals

Question 33, GATE 2026: A full binary tree has 23 nodes. Height is the number of edges on its longest root-to-leaf path. Find the largest possible height.
Tap to enlarge
Answer & solution

Official answer: 11

Givens and goal

A full binary tree has 23 nodes. Height is the number of edges on its longest root-to-leaf path. Find the largest possible height.

Approach

Count internal nodes using the full-tree property, then arrange them along one deepest branch.

Step-by-step solution

1. “Full” means every node has either zero children or exactly two children; it does not mean balanced or complete. Let I be the number of internal nodes and L the number of leaves.
2. Every internal node contributes two child edges, so the total edge count is 2I. Any tree with I+L nodes has I+L−1 edges. Equating these gives L=I+1 and total nodes 2I+1.
3. With 23=2I+1, there are I=11 internal nodes and L=12 leaves.
4. A root-to-leaf path of h edges has h nonleaf nodes before the final leaf. All h are internal, so h≤I=11.
5. This bound is achievable by a comb: each of the first ten internal nodes has one leaf child and one internal child continuing the path; the eleventh has two leaf children. There are 11 internal nodes, 12 leaves and a deepest path of 11 edges. Therefore the maximum height is 11, not the roughly logarithmic height of a balanced tree.

Original paper, page 23 · Answer key