← Back to DSA Visualizer

AVL Tree Visualization

AVL Tree is a self-balancing binary search tree where the heights of the two child subtrees of any node differ by at most one. Automatic rotations maintain balance for guaranteed O(log n) operations.

Tree Height

0

Node Count

0

Current Operation

None

Rotation Type

None

AVL Operations

Animation

Enable to see detailed rotation process

Tree Management

Balance Status

• h: height of node

• b: balance factor

• |b| ≤ 1 for AVL property

Balanced Node
Unbalanced Node
Current Node
Rotating Node
⚖️

Empty AVL Tree

Insert some nodes or generate a random AVL tree to get started!

AVL Tree Rotations

Rotation Cases:

  • Left-Left: Right rotation
  • Right-Right: Left rotation
  • Left-Right: Left-Right rotation
  • Right-Left: Right-Left rotation

AVL Properties:

  • • Balance factor: height(left) - height(right)
  • • Valid balance factors: -1, 0, 1
  • • Guaranteed O(log n) height
  • • Automatic rebalancing after operations