Skip to content

Apr 30: CodingBat Recursion

Learning Objectives

After today's class, you should be able to:

  • Describe the steps of recursive problem-solving.
  • Solve recursive problems using a helper method.
  • Implement recursive methods in Java.

Lesson Outline

Mini Lecture [10 min]

How to write a recursive function:

  • Step 0. Define a helper method (if applicable)
  • Step 1. Base case: how will the recursion stop?
  • Step 2. Current case: what needs to be computed?
  • Step 3. Recursion: how will the arguments change?

Writing [40 min]

Your To-Do List