AlgoScope

Inorder Traversal

AlgorithmbeginnerTree Traversals

Left subtree, then the node, then the right. On a search tree that comes out sorted.

Decision · step 2 of 9Tree Traversals: Inorder comes out sorted
20✓304050607080current

20 has nothing to its left, so it is written down first.

Open in the player →or start at step 2

What you will see

Focus goes all the way left first; nodes are stamped on the way back up.

How tree traversals works →

Cost

BestO(n)
AverageO(n)
WorstO(n)
SpaceO(h)

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.

Leads to

Topics that need this one first.