351 views
1 votes
1 votes
In deleting the root element of a BST, we have to replace root with  _________

a)Inorder successor

b)Inorder predecessor

c)Both a and b

1 Answer

0 votes
0 votes
Both are correct.

Inorder successor => Replacing with minimum value element from right subtree
Inorder predecessor => Replacing with maximum value element from left subtree

In both cases BST property will be peserved.

Related questions