edited by
785 views
0 votes
0 votes

Suppose we have to insert the following sequence of keys into an empty binary search tree:

$\text{5, 7, 45, 60, 50, 23, 15, 54}$

What would be the height of binary search tree?

  1. $3$
  2. $4$
  3. $5$
  4. $6$
edited by

2 Answers

Best answer
0 votes
0 votes

The height of the tree is the longest path from the root to any leaf node.

In BST insertion value less than the root goes to the left side and a value greater goes to the right side of the root.

Option $C$ and $D$ both are correct here.

NOTE 1) if the root node is at hight=0 then the height of the tree is $5$.

           2) If the root node is at hight=1 then the height of the tree is $6$. 

BST simulator

selected by
0 votes
0 votes
Option D is correct .

root node is at height = 1 then the height of the tree is 6 .

Related questions

1.4k
views
4 answers
3 votes
gatecse asked Dec 9, 2020
1,416 views
There are $6$ boxes numbered $1, 2, \dots\dots,6$. Each box is to be filled up either with a red or a green ball in such a way that at least $1$ box contains a green ball...
758
views
2 answers
2 votes
gatecse asked Dec 9, 2020
758 views
Number of letter repeated in the given word $’MEASUREMENTS’$ are indicated in front of each alternative. Identify the correct alternative.$M_2E_2A_2S_2U_1R_1N_1T_1$$M...
731
views
1 answers
2 votes
gatecse asked Dec 9, 2020
731 views
If $09/12/2001(DD/MM/YYYY)$ happens to be Sunday, then $09/12/1971$ would have been a:WednesdayTuesdaySaturdayThursday
827
views
2 answers
2 votes
gatecse asked Dec 9, 2020
827 views
If a cube with length, height and width equal to $10\; cm$, is reduced to a smaller cube of height, length and width of $9\; cm$ then reduction in volume is :$172\;cm^3$$...