Self-Balancing Trees

AVL Tree Visualizer

Experience self-balancing trees in action. Watch how node rotations maintain O(log n) height.

📜 Execution Log

Insert a node to see rotations triggered by imbalance.

🏗️ Balancing Rules

An AVL Tree ensures the height difference (balance factor) between left and right subtrees is at most 1.

Rotations:
• Left-Left (LL)
• Right-Right (RR)
• Left-Right (LR)
• Right-Left (RL)

💡 Complexity

  • Search: O(log n)
  • Insert: O(log n)
  • Delete: O(log n)
  • Balance Check: O(1)
Riverside