CS 111: Introduction to Computer Science

Recursion notes

Nothing to hand in

Example scenarios from class 11/2

Learning to think recursively takes practice. Roughly, you have to ask the question "does the problem I'm trying to solve have a smaller version of the same problem inside it?" or alternatively "can I solve my problem by first solving a smaller problem of the same type and then doing a little bit of computation?"

Here are some example scenarios that we looked at in class.

Some code