Recursion
Let's say you know how to climb one step:
function step_up(step):
hwup!
How do you climb a staircase?
Iteratively:
function climb(stairs):
for each step in stairs:
step_up(step)
Recursively:
function climb(stairs):
step_up(the first step)
climb(the rest of the stairs)
TODO:
- head and tail recursion
- why should we care?