Suppose we have to insert the following sequence of keys into an empty binary search tree: 5, 7, 45, 60, 50, 23, 15, 54 What would be the height of binary search tree?

Suppose we have to insert the following sequence of keys into an empty binary search tree: 5, 7, 45, 60, 50, 23, 15, 54 What would be the height of binary search tree? Correct Answer 5

The correct answer is option 3.

Key Points

A binary search tree, as a result, will be and  height = 5 

Confusion Points

 A binary search tree, as a result, will be and  height = 6

 

Mistake Points

  • Here the height of the tree is not specified that's why we got multiple answers. By default, the height of the binary tree is the longest path from the root node to any leaf node in the tree.

∴ Hence the correct answer is 5.

Related Questions

Postorder traversal of a given binary search tree T produces following sequence of keys: 3, 5, 7, 9, 4, 17, 16, 20, 18, 15, 14 Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?