This lab will help you learn more about linked lists as well as classification. in the package stringList you will develop a new class stringLinkedListSortedItr that extends stringLinkedListItr and enables us to mainatain a sorted list of strings.
cd public-html/classes/csc241
cp -r ~mohammad/public-html/classes/csc241/stringList .
-- don't forget the dot or the -r. This command replicates my stringList directory and places it in your account.
The following should be used as a template in creating this new class. Note that the other methods from stringLinkedListItr are simply inherited as well the variables current_ and myList_.
public class stringLinkedListSortedItr extends stringLinkedListItr { public stringLinkedListSortedItr( stringLinkedList anyList ) { } public void insert( String x ) { } public void insertAtBeginning( String x ) { } }
Using test2.java as a model develop a test program for stringLinkedListSortedItr. If you use the same set of insert and remove statements from test2.java, your expected output will be:
>java testSort Size is 6 1 2 3 4 5 6 After removing 3 things Size is 3 4 5 6