Questions: AVL Tree Rotations and Balancing

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

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?

AO(log n) reassignments, since the rotation propagates up toward the root
BO(n) reassignments, since all nodes below must be updated
CA constant number of pointer reassignments, regardless of tree size
DO(height) reassignments, since each level on the path must be visited
Question 2 Multiple Choice

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?

ABecause LR imbalances require an O(n) correction pass
BA single rotation at the violation node moves the left child up, but the heavy part (the grandchild) ends up in the wrong position, effectively flipping the imbalance
CSingle rotations only restore balance when the tree height is odd
DThe LR case means no balanced configuration exists for that subtree
Question 3 True / False

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.

TTrue
FFalse
Question 4 True / False

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.

TTrue
FFalse
Question 5 Short Answer

Explain why the AVL balance requirement (|height difference| ≤ 1 at every node) guarantees O(log n) tree height, and why this matters for performance.

Think about your answer, then reveal below.