Data Structures & AlgorithmsModerateTCS NQT · Trees

What is the maximum number of nodes in a binary tree of height 5, where the height is the number of edges on the longest root-to-leaf path?

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

Correct answer: D. 63

A full binary tree of height h has 2^(h+1) - 1 nodes, so 2^6 - 1 = 63.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic