C SC 205 Lab 5: Thinking Recursively

Turn in before next lab.

It may be useful to refer back to the PowerPoint presentation from yesterday as you work on this lab. You can download it here.

For the first two problems below, perform the following steps:
  1. Identify a way to decompose the problem into smaller problem(s) of the same kind. Explain in English your decomposition.
  2. Assuming that an operation exists that will solve these smaller problems, take the client-view towards this operation in order to solve the larger problem. Write the Java code for the method based on this solution.
  3. Fill out two trace worksheets for your solution: one with an input representing the base case, and the other with a small input that is not a base case.
NONE OF YOUR ALGORITHMS SHOULD HAVE while OR for LOOPS!
  1. Implement a recursive method that when given a String object will determine whether it is a palindrome.
    		public boolean isPalindrome (String s)
    
  2. Implement a recursive method to implement the binomial coefficient n choose k, .
    		public int binomial (int n, int k)
    
  3. Finish the implementation of SnowFlake.java. You will also need Koch.java.
Send the email attachments to DStucki@otterbein.edu.

Last updated: