All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · 22 June 2026

The number of leaf nodes in a full 4-ary rooted tree of n nodes is

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. (3n + 1) / 4

Explanation

In a full k-ary tree, every internal node has exactly k children, so if there are I internal nodes and L leaf nodes, the total number of edges equals kI; since any tree with n nodes has exactly n − 1 edges, kI = n − 1, giving I = (n − 1)/k. The number of leaves is then L = n − I = n − (n − 1)/k = ((k − 1)n + 1)/k. Substituting k = 4 gives L = (3n + 1)/4. So the number of leaf nodes is (3n + 1)/4.

More Data Structures and Algorithms questions