CSC 502 Homework 3: Linked Lists Exercises

In this lab, you will gain experience working with linked lists 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, like the size() and add have already been implemented. Methods not already implemented throw an UnsupportedOperationException. Remove the exception code and replace it with your own code.

To test a method, simply type the name of the method followed by the parameters. If there is more than one parameter, the parameters are separated by spaces. For example,

add one
indexOf mama
count mama
uppercase 2

Due Date: Friday of Week 6.