AVL Tree

Domain: Data Structures

🎯 Motivation

A plain BST can become unbalanced (like a linked list) after many insertions. AVL trees self-balance to guarantee fast operations.

📋 Concrete Example

After inserting nodes that tilt the tree, AVL performs rotations to keep the height difference between left and right subtrees at most 1.

🔗 Analogy

A mobile (hanging sculpture) that rebalances itself. If you add weight to one side, it rotates to keep both sides roughly equal so it never tilts too far.