Study this topic

Recursion

A function is recursive when it calls itself, directly or through other functions. Recursion expresses a problem in terms of smaller instances of the same problem: the factorial of n is n times the factorial of n-1; a binary tree is a root with two smaller binary trees.

Short notes6 min read

Tracing Recursion and Counting Calls

For a short recursive C function there are four things to determine: what it prints, what it returns, how many times it is called (or how many times some line runs), or what a variable holds afterwards. Each has a reliable mechanical method.

Short notes7 min read

Recursion cheat sheets

One-page visual sheets for this topic, in the sheet library on the store. Previews are free; the full sheets come with the subject pack.

Cheat sheets2 sheets