CIS2168 - Homework 4 [Modified from Dr.
Koffman]
Handed out: 09/21/10
Due: by 10pm on 09/27/10
Use the code provided in this directory and:
- Rename SLListPartial to SLList and complete it by writing code for the
methods that are stubs. Do NOT use private methods addFirst, addAfter,
getNode shown in the text
- Write a SLLIstIter inner class for SLList. This class should implement
Iterator, not ListIterator. Write methods hasNext, next, and remove for
this class.
Test your code by
- reading the tokens in the file
data.txt and adding them to an SLList of String
- traversing the list printing its content
- Removing from the list all tokens of length greater than 5
- traversing again the list printing its content
For the ambitious: do the homework approximating the LinkedList class and the ListIterator.
This means that you will have to implement a doubly linked list and that your iterator will have to
contain not just a Node reference but also an index.