Which of the following correctly describes the case when deleting a node with two children in a Binary Search Tree (BST)?
Think about how to maintain BST properties after deletion.
When deleting a node with two children, we replace it with its in-order predecessor (maximum node in left subtree) or in-order successor (minimum node in right subtree) to maintain BST order. Then we delete that predecessor or successor node, which will have at most one child.
How many children can a node have in a BST when it is deleted using the simplest case?
Consider the easiest deletion cases first.
The simplest deletion cases in BST are when the node has zero or one child. These cases are straightforward because the node can be removed or replaced by its single child without violating BST properties.
Given a BST where the root node has two children, what will be the root node's value after deleting the root?
Initial BST root value: 15 Root has left child 10 and right child 20. After deleting root, which value replaces it?
Recall the in-order successor concept.
When deleting a node with two children, the node is replaced by its in-order successor, which is the minimum value in its right subtree. This maintains BST order.
Which statement correctly compares using the in-order predecessor versus the in-order successor when deleting a node with two children in a BST?
Think about where predecessor and successor come from in the BST.
The in-order predecessor is the maximum node in the left subtree, and the in-order successor is the minimum node in the right subtree. Both can replace the deleted node to maintain BST properties.
What is the effect on the height of a BST after deleting a leaf node?
Consider how height is defined in a tree.
The height of a BST is the length of the longest path from root to a leaf. Deleting a leaf node only decreases height if that leaf was on the longest path. Otherwise, height remains unchanged.