Data Structures & AlgorithmsEasyTCS NQT · Wipro pattern

In a binary tree whose root is at level 0, what is the maximum number of nodes at level 5?

  1. A. 31
  2. B. 63
  3. C. 32
  4. D. 16

Correct answer: C. 32

Each level can at most double the previous one: 1, 2, 4, 8, 16, 32 → 2⁵ = 32 at level 5. 63 = 2⁶ − 1 is the maximum number of nodes in levels 0–5 combined; 31 is levels 0–4.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic