Which statement(s) is/are correct regarding node N deletion in binary search…
2021
Which statement(s) is/are correct regarding node N deletion in binary search tree?
I. If node N has no children then just replace location of N in the parent node by the null pointer.
II. If node N has two children, then replace it by preorder successor.
- A.
Only I
- B.
Only II
- C.
Both I and II
- D.
Neither I nor II
Attempted by 225 students.
Show answer & explanation
Correct answer: A
Deleting a node in a Binary Search Tree (BST) depends on the number of children.
Statement I is correct: If the node has no children (a leaf), simply update the parent's pointer to null.
Statement II is incorrect: A node with two children must be replaced by its inorder successor or predecessor to maintain BST properties, not the preorder successor.
Thus, only Statement I is correct.