Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height 5 are
    1. 63 and 6, respectively
    2. 64 and 5, respectively
    3. 32 and 6, respectively
    4. 31 and 5, respectively
Correct Option: A

We know that the maximum no. of nodes in a binary tree with (height) h = 2h + 1 – 1.
Here h = 5, then, we easily calculate the h as :
h = 25 + 1 – 1= 64 – 1 = 63
And the minimum no. of nodes with height h is h + 1.
∴ h = 5



Your comments will be displayed only after manual approval.