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

Programming and data structure miscellaneous

Programming & Data Structure

  1. The number of ways in which the numbers 1, 2, 3, 4, 5, 6, 7 can be inserted in an empty binary search tree, such that the resulting tree has height 6, is ________.
    Note : The height of a tree with a single node is 0.
    1. 16
    2. 53
    3. 8
    4. 64
Correct Option: D

To fill 7 levels with 7 elements, at each level we have exactly 2 possible options like 1 and 7 for root one corresponding to making it left skewed and other right skewed. This is valid for all levels upto 6.
Hence, 26 = 64.



Your comments will be displayed only after manual approval.