Tuesday - Lecture 10 - Iterative Recursion
Date: July 07
Date: July 07
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.)
In-Class Resources
| Link | Title | Type | Duration |
|---|---|---|---|
| Video 1 | Lecture 10.1 - Intro | pre-recorded | 9:22 |
| Video 2 | Lecture 10.2 - Rewriting fold | pre-recorded | 2:46 |
| Video 3 | Lecture 10.3 - Helper Functions | pre-recorded | 8:49 |
| Video 4 | Lecture 10.4 - Tree Recursion | pre-recorded | 4:19 |
| Video 5 | Lecture 10.5 - DrRacket Demos | pre-recorded | 15:09 |