YCP Logo Lab 17: Recursion

Due: Tuesday, Nov 11th by 11:59 PM

Getting Started

Import CS201_Lab17.zip (File->Import...->General->Existing Projects into Workspace->Archive File). You should see a project called CS201_Lab17 in the Package Explorer.

Your Task

Implement each static method in the class called Recursion. Each method has comments describing what it should do.

When you implement a method, remove the line of code reading

throw new UnsupportedOperationException("Not implemented yet");

A JUnit test class called RecursionTest contains test cases for each method.

You must use recursion in each method. Do not use a loop in any of the methods.

As you think about how to implement each method, consider:

  • What is a base case (or base cases) that can be solved without using recursion?
  • How can you find a subproblem which has the same form as the overall problem?
  • How can you extend the solution to the subproblem to solve the overall problem?

Submitting

When you are done, save the project (CS201_Lab17) to a zip file by right-clicking it and choosing

Export...->Archive File

Upload the saved zip file to the Marmoset server as lab17. The server URL is

https://camel.ycp.edu:8443/