Lab 11: CodingBat Recursion¶
For this lab, we will complete exercises from CodingBat.com to learn how to solve problems using recursion.
Learning Objectives¶
After completing this lab, you should be able to:
- Understand the fundamentals of recursive problem-solving.
- Implement recursive methods in Java.
- Write recursive solutions that utilize a helper method.
Login to CodingBat¶
Make sure you log in to CodingBat for your submissions to be counted. Grading will be done directly from CodingBat. If you have not yet set up your CodingBat account, please see the Lab02 instructions.
Warm-Up Problems (2pts)¶
First, let's brush up on your recursion writing skills!
Solve the following problems (spend no more than a few minutes on each):
Advanced Recursion (4pts)¶
The following problems involve recursion with strings. You may want to review the Java String methods first.
Challenging Problems (4pts)¶
These problems work with arrays, and will help you develop the skills needed to tackle the homework.
For these problems, it is required that you write a second, "helper" method that performs the recursion, and then call it to start the recursive process.
Extra Problems (optional)¶
If you finish early, complete these problems for practice: