Bifalgorithm post · Brisk · Chapter 1
How can we remove the Mal node while preserving the BST property?
How can we remove the Mal node while preserving the BST property? (Brisk · Chapter 1) — "Mal ” node from this tree, how would we do that? We can put the left-m…
Ideas in this flowchart
- Removing Mal from a binary search tree
- Replace Mal with the left-most node of Mal’s right subtree
- The replacement node is River
- Make Simon, with everything under him, Wash’s left child
- These changes produce a Mal-less tree
- The resulting tree contains River, Jayne, Inara, Kaylee, Zoe, Simon, and Wash
- Check whether the resulting tree satisfies the BST property
- The Mal-less tree satisfies the BST property
