Multiple choice

For height H and root at level 0, how many number of nodes will be there in a binary tree?

  1. 2H+1 - 1

  2. 2H-1

  3. 2H+1 + 1

  4. 2H+1

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

2H+1 - 1, gives total number of nodes present in any binary tree for tree at level 0. 2H gives the total number of nodes at any level. If root is at level zero, 2H+1 will give the same, e.g. at level 3, total no. of nodes will be 8 and total number of nodes at level 2 if root is at level 0, is 7. So this relation works here 2H+1 - 1.