flâneur — a map of the web's best reading

Recursion and Iteration | Course Readings | 6.101 Fall 2023

py.mit.edu · 26 words · saved by 1 readers

This reading is relatively new, and your feedback will help us improve it! If you notice mistakes (big or small), if you have questions, if anything is unclear, if there are things not covered here that you'd like to see covered, or if you have any other suggestions; please get in touch during office hours or open lab hours, or via e-mail at 6.101-help@mit.edu. This reading examines recursion more closely by comparing and contrasting it with iteration. Both approaches create repeated patterns of computation. Recursion produces repeated computation by calling the same function recursively, on a simpler or smaller subproblem. Iteration produces repeated computation using for loops or while loops. If we can come up with an iterative version, do we need recursion at all? In one sense, no, we don't need recursion -- any function we can write recursively could also be written iteratively. But, some problems lend themselves naturally to a recursive solution. When we try to solve those kinds o

Recursion and Iteration | Course Readings | 6.101 Fall 2023 Recursion and Iteration this page (from a previous semester) is no longer accessible, except for staff

Explore this link on the map →

related reading