LOGBOOK

HELP

Quiz Entry - updated: 2026.11.26

Remove 32 from the AVL tree with root 44, left child 17 (right child 32) and right child 62 (children 50, with 48 and 54, and 78, with right child 88). What happens?

32 is a leaf, so it simply goes. Its parent w = 17 is now a leaf, and 44 has children of heights 0 and 2: z = 44, y = 62. y's children 50 and 78 both have height 1, a tie, so x = 78 on y's own side, and a single left rotation lifts 62 to the root.

Remove 32: the root becomes unbalanced and a single left rotation repairs it

* The tie at y decides the case: x is taken on y's own side, so one rotation suffices. *

After the removal: 17 has no children (height 0), 62 still has height 2, so 44's children differ by 2. z = 44, the first unbalanced node above w = 17.

Choosing y and x: y = 62, the taller child of z. y's children are 50 (height 1) and 78 (height 1). With a tie, x is the child on the same side as y: y is a right child, so x = 78, the right child. z, y, x form a straight right-right line, so a single rotation.

Left rotation around 44:

  • 62 becomes the root;
  • 44 becomes 62's left child, keeping 17 as its left child;
  • 62's old left subtree, 50 with 48 and 54, moves over as 44's right subtree.

Result: 62 at the root, 44 (children 17 and 50) and 78 (right child 88) below it. All keys between 44 and 62 (48, 50, 54) are still between them, now on 44's right. The new root has children of heights 2 and 1: balanced. No ancestor is left to check, so the walk ends. Reading the result in inorder (17, 44, 48, 50, 54, 62, 78, 88) confirms that the order survived.

From Quiz: ADS / AVL Trees and Splay Trees | Updated: Nov 26, 2026