Make your own free website on

To delete a node with 2 subtrees, e.g. 6 in:

Erase 6, but keep its node:
Find value that can be moved into vacated node while preserving BST properties. Pick X such that:
  1. everything in left subtree < X
  2. everything in right subtree > X
If we get X from left subtree, (2) is guaranteed.

For (1), X must be largest value in left subtree, i.e. 3.