Mental Model
Deleting a node in a BST means removing it while keeping the tree sorted. We find the node, then fix the tree by rearranging nodes if needed.
Analogy: Imagine removing a book from a sorted bookshelf. If the book is alone, just take it out. If it has neighbors, you might need to shift or replace it with a nearby book to keep order.
5
/ \
3 7
/ \ \
2 4 8
βroot