Which statement(s) is/are correct regarding node N deletion in binary search tree?
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.
Show answerHide answer
Correct answer: (A) Only I
Explanation
A leaf node is removed by setting its parent's pointer to null (I correct). A node with two children is replaced by its inorder successor (or predecessor), not its preorder successor, so II is wrong.