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

Discussion

What is the maximum number of nodes at level 'L' in a binary tree ?

  • A.\(2^{L}\)
  • B.\(2^{(L - 1)}\)
  • C.\(2^{L} - 1\)
  • D.\(L^{2}\)

Answer: A

The maximum number of nodes at level L is \(2^{L}\), counting the root as level 0.

Each node has at most two children, so each level can hold at most twice as many nodes as the one above: 1 at level 0, 2 at level 1, 4 at level 2, and \(2^{L}\) at level L.

Some books number the root as level 1, and with that convention the same count is written \(2^{L-1}\). The key follows the root-at-level-0 convention. \(2^{L} - 1\) is a different quantity, the total number of nodes in a full tree of L levels, and \(L^{2}\) grows far too slowly.

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

Post your comment

Please log in or register to post a comment.