AlgoScope

Balance Factor

AnalysisintermediateAVL Tree

Left height minus right height. Every node must stay within -1, 0 or 1.

Decision · step 6 of 26AVL Tree: Already balanced, no rotations
1020current

At 20: 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

Each node shows its factor; the one outside the range is flagged.

How avl tree works →

Cost

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.

Before this

Leads to

Topics that need this one first.