Extension 1 for this module:
Binary Search Tree Deletion
Implement deletion properly in your binary search tree. In particular, suppose you want to remove node x from the tree.
- If x is a leaf, let x's parent refer to null instead.
- If x has only one child, let x's parent refer to x's child instead.
- In the difficult case, when x has two children, you can replace x in the tree by the rightmost element in x's left subtree.
End of extension 1