We want to delete a node i.
- If i has zero child, delete it.
- If i has one child, delete i and move i's child into i's place.
- If i has two children, let j be the successor of i. Delete j
in place (it has at most one child, so that's easy). Now, move j into
i's place.
Why is this well defined? In particular, how do we know that j
has at most one child?
Next: Successor Tree Walk
Up: BINARY SEARCH TREES
Previous: Where is the Successor?