<aside> ⚖️

L6 — Keep Trees Balanced covers BST deletion (three cases), why balancing matters, rotations (single and double), AVL trees (definition, minimum-node recurrence, logarithmic-depth proof), balance-factor implementation with a full worked insertion example, AVL deletion notes, and Java's TreeSet/TreeMap.

</aside>

📋 At a Glance


1. BST Deletion

Removing a node from a BST has three cases, ordered by difficulty.

Case 1 — Leaf Node (no children)

Simply set the parent's pointer (left or right) to null.

Example: removing 50 from the tree — just unlink it.