AlgoScope

AVL Tree

Data structureadvancedBalanced Search Trees

A search tree that rotates itself back into balance whenever two sides differ in height by two.

Decision · step 6 of 41AVL Tree: A longer mixed sequence
2550current

At 50: left height 1, right height 0, balance 1. Within one, so it stays.

Open in the player →or start at step 6

What you will see

Balance factors on nodes; an imbalance triggers a visible rotation.

How avl tree works →

Cost

searchO(log n)
insertO(log n)
deleteO(log n)
SpaceO(n)

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, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Leads to

Topics that need this one first.