Lab 12: Fruitful Recursion
Worksheet Solutions
Python Solutions
Summary
- Part 0: Worksheet warm-up
- Part 1: Simple Fruitful Recursion
- Part 2: Branching Recursion
- Part 3: Extra Exercises
Setup
There is no folder to download for today. Create a lab12
folder on your desktop and save your files in that folder.
Table of Contents
- Lab 12 Home
- Part 0: Worksheet warm-up
- Part 1: Simple Fruitful recursion
- Part 2: Branching Recursion
- Part 3: Extra Exercises
- Strategy: case-by-case method
- Strategy: use-it-or-lose-it method
- Knowledge Check
Big Questions
- In a fruitful recursive function, which function frames contribute to the
value returned by the original function frame?
Show Answer
The answer here is "all of them." Although only the original function frame directly returns the result value, it will typically use information returned by other function frames to construct that value, so all of the function frames end up contributing to the eventual result somehow.