AlgoScope

AVL Delete with Rebalancing

AlgorithmadvancedAVL Tree

Delete like a BST, then rebalance every ancestor; unlike insert, several rotations may be needed.

Decision · step 2 of 7AVL Tree: Delete a leaf and rotate above it
5101525273050✓556075✓90×current

Found 90 as the right child of 75. It is a leaf, so it is simply unlinked.

Open in the player →or start at step 2

What you will see

The path to the root is walked; more than one node may rotate.

How avl tree works →

Cost

BestO(log n)
AverageO(log n)
WorstO(log n)
SpaceO(1)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next, try operations in any order.

Screen readers: Nodes announce value, left child and right child; each step announces the comparison and the direction taken or the structural change.

Reduced motion: Focus jumps node to node with a static ring; rotations become a crossfade between the two layouts.