edited by
6,895 views
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
edited by

3 Answers

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.
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.

Related questions

1 votes
1 votes
2 answers
3
aaru14 asked Dec 7, 2017
2,345 views
assume the preorder tŕaversal of binary tree is "abc" how many total different binary trees are possible whose postorder traversal.is "cba" with the given preorder trave...
2 votes
2 votes
1 answer
4
arya_stark asked Jul 4, 2018
7,132 views
Preorder is same as :a) depth-first order b) breadth-first searchc) topological order d) linear order