CSC 161 Lab 9-1: Recursive Operations on Linked Lists

In this lab, you will gain experience developing recursive linked list operations by implementing methods on a linked list class provided by the instructor. You can download the zipped up Netbeans project here. Unzip it into a local folder and fill in code to implement the following methods.

void add(String value)
void add(int index, String value)
void addList(String []values)   // Example: addList ann joe beth billy
boolean remove(String value)
void removeAll(String value)    // remove all occurrences of the string from the list
String remove(int index)
int size()
String get(int index)
String set(int index, String value)
int indexOf(String value)
boolean contains(String value)
int count(String value)
void upperCase(int index)
void lowerCase(int index)
void reverse()

Some of these methods, have already been implemented. These include all three add methods, the remove(index), and the remove(value) methods. You can look at these methods to see further examples of recursion.

Methods not already implemented throw an UnsupportedOperationException. Remove the exception code and replace it with your own code.

You may want to implement these methods in order of increasing complexity. I recommend the following order.

int size()
int count(String value)
boolean contains(String value)
void upperCase(int index)
void lowerCase(int index)
String get(int index)
String set(int index, String value)
int indexOf(String value)
void removeAll(String value) 
void reverse()

All methods must use recursion. Note that in most cases, you do not need a loop if you are using recursion. The rule is that a problem that can be solved with a single loop does need to use a loop and recursion. The only problem here that needs a loop and recursion is the reverse().

Due Date: Wednesday of Week 10.