Today we’ll follow up with another version of recursion. In our previous lecture, we covered a type of recursion that was essentially “waiting until the very end of the expression to do all of the work” (for a better idea of what this means…take a look at the substitution model video from last time).
Iterative recursion takes a slightly different approach. It requires a sort of memory (we call an accumulator) which allows it to “do a little bit of the work along the way before trying to recurse.” While we won’t get there in this class, in 211 and 214, you’ll see why iterative recursion actually allows us to solve even more complex problems than regular recursion (specifically because of the memory constraints of everyday computers.)
AGAIN, PLEASE watch the videos before coming to class to work on the Tutorial.
Today's Resources
1. Exercise Files
Download Exercise Files2. Slides
3. Pre-Recorded Lecture Video(s), Mini-Quizzes, and Live Recordings
| Link | Title | Type | Duration |
|---|---|---|---|
| Video 0 | Intro | pre-recorded | 2:44 |
| Video 1 | Iterative Recursion | pre-recorded | 8:59 |
| Video 2 | Helper Functions (MQ - No Longer Available) | video_quiz | 6:23 |
| Video 3 | Tree Recursion | pre-recorded | 5:40 |