DFS with a Visible Call Stack
Making recursion physical.
This animation makes recursion something you can watch: an explorer token walks a tree depth-first while a call-stack panel mirrors every move.
The explorer dives down the leftmost branch, laying a glowing breadcrumb trail. Each dive pushes a frame onto the stack panel — one frame per unfinished call, and the trail is the stack: the chain of calls waiting for answers. When the explorer hits a null (an empty child), the dead end flashes, the trail retracts one step, and a frame pops. That retreat is all "backtracking" means.
The moment to watch: when both of a node's subtrees are finished, the subtree dims and the node displays its computed value — say, its height — which then bubbles up to the waiting parent frame. Watch the parent combine its two child values the instant the second one arrives (1 + max(left, right)). Answers form at the leaves and assemble upward; nothing is known on the way down, everything on the way back.
Also track the stack's height: it peaks at the deepest dive. That is the O(h) space cost of DFS — and why a chain-shaped tree is the recursive worst case.