Why it matters
AVL is foundational balanced tree. Understanding shapes broader BST knowledge.
Advertisement
The architecture
Balance factor: height(left) - height(right). |bf| ≤ 1 invariant.
Insert/delete may violate; rotations restore.
Advertisement
How it works end to end
Rotations: left, right, left-right, right-left. Restore balance after insert/delete.
Height: guaranteed log_φ(n) where φ is golden ratio.
Trade-off: tighter balance means more rotations than red-black; faster search.