0 votes 0 votes If a node in a BST has two children, then its in-order predecessor has a) No left child b) No right child c) 2 children d) no child DS data-structures tree tree-traversal + – smartmeet asked Feb 8, 2017 edited Jun 20, 2019 by Cristine smartmeet 6.9k views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments smartmeet commented Feb 8, 2017 reply Follow Share Explain plz! 0 votes 0 votes Smriti012 commented Feb 8, 2017 reply Follow Share INORDER OF THIS EXAMPLE IS 3 4 5 6 7 9 17 20 22 TAKE NODE 9.... ITS INORDER PREDECESSOR IS 7... 7 HAS NO RIGHT CHILD...(ANSWER) 0 votes 0 votes Ashwani Kumar 2 commented Feb 8, 2017 reply Follow Share Yes it will be no right child for predecessor, i have read inorder succcessor, for that no left child 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes no right child cse23 answered Feb 8, 2017 cse23 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Inorder traversal gives sorted sequence. Inorder predecessor will be just the previous max value. So right child should not be there as right child is greater than that node value. Tanmoy Mondal answered Feb 10, 2017 Tanmoy Mondal comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes The answer should be No right child, as if there is a right child then that right child would become inorder predecessor of the node. There may or may not be a left child, because a left child would not affect inorder predecessor of the node. nachi37 answered Jul 31, 2019 nachi37 comment Share Follow See all 0 reply Please log in or register to add a comment.