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.

Answer: A. Only IDeleting 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…

  1. A.

    Only I

  2. B.

    Only II

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 559 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.

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…