For this assignment, you will write a class called Recursion that will consist of several static methods plus a main program to test those methods. Recursion should include the following methods, plus any other methods (if any) that you find helpful. All of the methods listed below should use recursion to solve their problems.
public static boolean isPalindrome( String s ) returns true if the specified string is a palindrome, and false otherwise. A palindrome is a string that reads the same backwards as forwards. For example, "Sit on a potato pan, Otis!" is a palindrome. You will need to strip the whitespace and punctuation, and capitalization from the string before testing it for palindromicity (yes, I said "palindromicity"--you wanna make something of it?).
public static int charCount( char ch, CharNode head ) returns the number of times the specified character appears in the specified linked list of CharNodes. The recursion here is pretty easy to do, but you'll need to construct linked lists to test it. You may want to exploit the set method in the CharList class.
public static void printPermutations( StringBuffer s ) should print to standard output all the permutations of the characters in s. This one is trickier than the first two. Note that I'm specifying a StringBuffer parameter here. This is because this problem is much easier to do if you can move the characters around in the string. String doesn't let you modify a string once it's built, but StringBuffer does.
I did not say that the methods listed above have to be recursive themselves--only that they need to use recursion to solve their problems. For example, it would be completely reasonable for isPalindrome to first create a new string that's all lower case and has only letters in it, and then call a recursive method named, say, recursiveIsPalindrome to do the rest of the work.
Before coding, think: how can I break this problem down into a smaller problem of the same type? For example, a string is a palindrome if the first and last letters are the same and the string with the first and last letters removed is also a palindrome.
Have fun, start early, and keep in touch.