Operations
5x
Presets
Tree Stats
Nodes:0
Height:0
Balanced:—
Rotations:0
Operation Log
AVL Properties
AVL Tree is a self-balancing BST where the balance factor of every node is in {-1, 0, +1}.
Balance Factor = height(left) - height(right)
Rotations:
• Left Rotate — right-heavy node (BF < -1)
• Right Rotate — left-heavy node (BF > 1)
• Left-Right — left child is right-heavy
• Right-Left — right child is left-heavy
Guarantee: All operations are O(log n) because height is always O(log n). For n nodes, height ≤ 1.44 * log2(n+2).
Balance Factor = height(left) - height(right)
Rotations:
• Left Rotate — right-heavy node (BF < -1)
• Right Rotate — left-heavy node (BF > 1)
• Left-Right — left child is right-heavy
• Right-Left — right child is left-heavy
Guarantee: All operations are O(log n) because height is always O(log n). For n nodes, height ≤ 1.44 * log2(n+2).