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? $3$ $4$ $5$ $6$ Unknown Category nielit-scb-2020 + – gatecse asked Dec 9, 2020 • edited Dec 12, 2020 by soujanyareddy13 gatecse 735 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
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 Hira Thakur answered Dec 10, 2020 • selected Mar 5, 2021 by Shaik Masthan Hira Thakur comment Share Follow See all 3 Comments See all 3 3 Comments reply Shaik Masthan commented Dec 10, 2020 reply Follow Share root height =0 or 1 ? as per me, there is no standard reference for it. So option D also correct. 0 votes 0 votes Hira Thakur commented Mar 5, 2021 reply Follow Share Shaik Masthan yes, you can take. both options are correct. 2 votes 2 votes Shivanan commented Apr 24, 2023 reply Follow Share Height of the tree is the number of edges in the tree from the root to the deepest node. So answer is clearly C. i.e. 5 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes Option D is correct . root node is at height = 1 then the height of the tree is 6 . madhurKG answered Dec 8, 2023 madhurKG comment Share Follow See all 0 reply Please log in or register to add a comment.