Skip to content
Official PYQ · 2026

GATE CS 2026 Set 1 Q23 — Searching, Sorting, Hashing

Explain with AI
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 2323 nodes is ____\_\_\_\_.(answer in integer)
View worked solution

Answer: 11 : 11

A full binary tree (or strict binary tree) is a binary tree in which every node has either 00 or 22 children.

To find the maximum possible height hh for a given number of nodes NN, we must construct a tree that is as skewed as possible. In such a tree, each level from level 11 to level hh contains exactly 22 nodes (one internal node and one leaf node, except the last level which contains two leaf nodes).

The minimum number of nodes NN required to achieve a height hh in a full binary tree is given by:

Nmin=2h+1N_{\text{min}} = 2h + 1

For a given number of nodes NN, the maximum height hh satisfies:

h≤N−12h \le \frac{N - 1}{2}

Substituting N=23N = 23 into the inequality:

h≤23−12=11h \le \frac{23 - 1}{2} = 11

Thus, the maximum possible height of a full binary tree with 2323 nodes is 1111.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Searching, Sorting, Hashing questions