Recursion
Recursion: How Big Is This Folder? Recursion, The Folder Tool That Never Stopped: Base Cases, Where Do the Waiting Calls Wait? The Call Stack.
Updated
- How Big Is This Folder? Recursion (Apprentice): Work out how big a folder is when it holds folders, which hold more folders, as deep as anyone made them: why one loop, a loop in a loop and a loop per level all come up short, and the idea that fixes them, recursion.
- The Folder Tool That Never Stopped: Base Cases (Apprentice): Find out why the folder tool crashed on one customer's drive, and make every recursive function you write stop: why a bigger stack, catching the error and a depth limit all fall short, and the two rules of a base case that fix it.
- Where Do the Waiting Calls Wait? The Call Stack (Apprentice): Trace any recursive function by hand, and see why recursion that goes too deep runs out of room: how a program keeps every waiting call's own values and the way back to it, which a single variable or a single bookmark can't do.