0 votes 0 votes Given only pre-order of a Binary Search Tree, Can we identify a Binary Search Tree Uniquely? Jithin Jayan asked Jul 13, 2016 Jithin Jayan 499 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes yes inorder search tree is just increasing order of elements So, now from inorder and preorder we can find BST srestha answered Jul 13, 2016 srestha comment Share Follow See 1 comment See all 1 1 comment reply Jithin Jayan commented Jul 13, 2016 reply Follow Share When only pre-order is given.Is it possible? And inorder is not given. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes no not possible suppose 1,2,3 is three elements it has two graphs so not unique asu answered Jul 13, 2016 asu comment Share Follow See all 3 Comments See all 3 3 Comments reply Jithin Jayan commented Jul 13, 2016 reply Follow Share The question is Binary Search Tree and not Binary tree. So only second graph is possible right. First Graph is not a BST. 0 votes 0 votes asu commented Jul 14, 2016 reply Follow Share yes u r right..if it is a binary search tree then from preorder...we can find the inorder(sorted increasing order) can construct a unique bst 0 votes 0 votes Jithin Jayan commented Jul 14, 2016 reply Follow Share Yes Right Thank you. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes NO, either for BST or Binary tree we need atleast 2 traversals for unqiue indentification of tree. Brijesh answered Aug 23, 2016 Brijesh comment Share Follow See all 0 reply Please log in or register to add a comment.