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

Programming and data structure miscellaneous

Programming & Data Structure

  1. Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are :
    Note : The height of a tree with a single node is 0.
    1. 4 and 15 respectively
    2. 3 and 14 respectively
    3. 4 and 14 respectively
    4. 3 and 15 respectively
Correct Option: B

Since there are 15 nodes, hence the minimum height of the tree will be 3 (when tree will be balanced).

Min. height = floor (log2 N)
= floor (log2 15) = 3
The maximum height will be when the tree is skew tree, which will give rise to height 14 either it will be left or right skewed tree. Hence option (b) is correct.



Your comments will be displayed only after manual approval.