5 questions to test your understanding
After inserting a node into an AVL tree, a node has a balance factor of +2 and its left child has a balance factor of +1 (left-left case). How many pointer reassignments does the single right rotation require?
A newly inserted node creates a left-right (LR) imbalance — the violation node's left child's right subtree is too tall. Why does a single right rotation at the violation node fail to fix this?
Because AVL trees maintain O(log n) height and each rotation is O(1), all three core operations — search, insert, and delete — run in O(log n) worst-case time regardless of insertion order.
When a node insertion into an AVL tree causes an imbalance, rotations should be performed at most ancestor node on the path from the new node to the root.
Explain why the AVL balance requirement (|height difference| ≤ 1 at every node) guarantees O(log n) tree height, and why this matters for performance.