In delete operation of BST, we need an inorder successor (or predecessor) of a…
2025
In delete operation of BST, we need an inorder successor (or predecessor) of a node when the node to be deleted has both left and right child as non-empty. Which of the following is true about the inorder successor needed in delete operation ?
- A.
Inorder successor is always either a leaf node or a node with empty left child.
- B.
Inorder Successor is always a leaf node.
- C.
Inorder successor may be an ancestor of the node.
- D.
Inorder successor is always either a leaf node or a node with empty right child.
Attempted by 97 students.
Show answer & explanation
Correct answer: A
When deleting a node with two children in a Binary Search Tree, we find the inorder successor by moving to its right child and then repeatedly traversing left until reaching a node with no left child. This successor is guaranteed to be the smallest value greater than the deleted node, maintaining BST properties after replacement.