Data Structures & AlgorithmsHardGATE CS · ICPC regional · Product Company SDE

A complete binary tree has 87 nodes. How many leaves does it have?

  1. A. 44
  2. B. 53
  3. C. 66
  4. D. 7

Correct answer: A. 44

Internal nodes = ⌊n/2⌋ = 43, so leaves = 87 − that = 44 (= ⌈n/2⌉).

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic