Overview
An AVL tree rotates after insertions or deletions so subtree heights differ by at most one, keeping lookups predictably logarithmic.
Maintains a binary search tree with strict height balance after updates.
Compact metadata for implementation and discovery.
An AVL tree rotates after insertions or deletions so subtree heights differ by at most one, keeping lookups predictably logarithmic.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log n)
Average
O(log n)
Worst
O(log n)
Space
O(n)
balance(v) = height(left(v)) - height(right(v))Detects when a node needs rebalancing.
Show the structure layout and how operations move through or update it.
AVL Tree should be used with the assumptions and tradeoffs of balanced Search Tree in mind.
What each reference supports for this entry.
Algorithms textbook support for AVL Tree's invariant, correctness argument, and asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Foundation
AVL Tree is a data-structure variant of Binary Search Tree with different update or query tradeoffs.
Compare with thisAVL trees and red-black trees are balanced binary search trees with different rebalancing tradeoffs.
AVL Tree is a data-structure variant of Binary Search Tree with different update or query tradeoffs.