04 Try it yourself Interactive

Watch the same walk print in two different places

Amber nodes are the calls currently sitting on the stack. The indigo ring is the node the machine is looking at right now; a rose ring means the call that node just made ran off a null link and returned with nothing, so the ring stays on the parent. Green nodes have already been printed. Switch the tab and step through again — the route never changes, only the moment the value drops into the output row.

Preorder walk
print → left → right
Exactly 7 whole numbers (0–99), in level order. The shape stays fixed.
printed output
Press Next to begin. Each press moves one step.


      
Stack depth
At node
Printed0
Null returns0
step 0 / 0