27 votes 27 votes The following numbers are inserted into an empty binary search tree in the given order: $10, 1, 3, 5, 15, 12, 16$. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)? $2$ $3$ $4$ $6$ DS gatecse-2004 data-structures binary-search-tree easy isro2009 + – Kathleen asked Sep 18, 2014 edited Dec 18, 2017 by kenzou Kathleen 22.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 41 votes 41 votes Height is 3 Correct Answer: $B$ Prashant. answered Nov 15, 2015 edited Jul 7, 2019 by Lakshman Bhaiya Prashant. comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments RACHAPUDI JAGADEESH commented Jun 10, 2021 reply Follow Share only height is asked not any other so wee need not to do it 0 votes 0 votes Swiss commented Oct 6, 2021 reply Follow Share They did not tell us to balance it. Balancing is carried out if it is mentioned that it is an AVL tree. 0 votes 0 votes KhushiRastogi commented Jan 5, 2023 reply Follow Share because they are not saying to balance , they have not even mentioned the word in thewhole question . in gate pyq the answer is “ only for exactly what is asked “ 0 votes 0 votes Please log in or register to add a comment.
9 votes 9 votes ans is (b) kvkumar answered Jun 26, 2016 kvkumar comment Share Follow See all 2 Comments See all 2 2 Comments reply s_dr_13 commented Jul 17, 2020 reply Follow Share what tool did you use bro to draw this ? Kinda curious 0 votes 0 votes rhl commented Sep 21, 2021 reply Follow Share This https://www.cs.usfca.edu/~galles/visualization/BST.html 1 votes 1 votes Please log in or register to add a comment.
6 votes 6 votes Ans) 3 Draw a BST for the given numbers And the Distance from root(i.e 10) to leaf(i.e 5) is 3. Prasanna answered Nov 15, 2015 Prasanna comment Share Follow See all 0 reply Please log in or register to add a comment.
5 votes 5 votes ans will be 3 . hence option (b) anonymous answered Dec 21, 2014 anonymous comment Share Follow See all 0 reply Please log in or register to add a comment.