Week 10: Recursion

SLOs for Week 10

By the end of this unit, the student will be able to:

  • describe recursion correctly to an elderly ancestor.
  • define the structure of a recursive solution – base case and recursive case.
  • correctly use the words “winding phase” and “unwinding phase”.
  • implement a basic recursive implementation – e.g., for the factorial function.
  • argue why a recursive solution is generally less efficient than an equivalent iterative solution.
  • describe the role the runtime stack plays in the execution of a recursive function.
  • understand the time complexity of the Towers of Hanoi problem.

Slides, videos, and application exercises

Week 10: Slides

No readings for Week 10.

Lab 10: Recursion

Project 10: Snake Game

Exam 3 Exam on Friday during class. Bring your laptop. Content: Weeks 0 - 8.