Question

The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with 23 nodes is _________. (answer in integer)

Official answer and solution
Official answer
11
From
Official GATE 2026 answer key

Solution

Minimize the number of nodes at each level of a full (strict) binary tree, where every internal node has exactly 2 children.

In a full (strict) binary tree, every node has either 00 or 22 children. To maximize the height hh for a given number of nodes n=23n = 23, each level from 11 to hh should contain the minimum possible number of nodes, which is 22 nodes per level (one internal node and one leaf at levels 1,…,h−11, \dots, h-1, and two leaves at level hh). Thus:

n=2h+1  ⟹  23=2h+1  ⟹  h=11n = 2h + 1 \implies 23 = 2h + 1 \implies h = 11
Final answer

11

Common trap

Confusing a full binary tree with a general binary tree (which would have max height 2222).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
Question
33 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.