Recursion and the call stack

A recursive function is easy to write and hard to picture. These five run on input you choose and record every call they make, so you can watch the stack pile up, watch each value hand back down it, and count what the whole thing cost.

5 algorithms

Sorting and searching live next door in AlgoLab.