Machine-translated by Google. Questions are authored in English.
Top

Discussion

A complete binary tree with 4 levels has a maximum of how many nodes ?

  • A.15
  • B.16
  • C.14
  • D.31

Answer: A

A binary tree with 4 levels has at most 15 nodes.

Level i (counting the root as level 1) can hold at most \(2^{i-1}\) nodes, so a full tree of h levels has:

\[ \begin{aligned} N &= 1 + 2 + 4 + 8 \\ &= 2^{4} - 1 = 15 \end{aligned} \]

16 is \(2^{4}\), forgetting the minus one. 31 is the count for 5 levels, and 14 falls one short.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.