Modify your MyArrayList and MyLinkedList classes from the previous two assignments to include a ListIterator. Use the following ListIterator interface:
public interface ListIterator<E> {
boolean hasNext(); // Returns true if this list iterator has more elements while traversing in the forward direction.
boolean hasPrevious(); // Returns true if this list iterator has more elements while traversing in the reverse direction.
E next(); // Returns the next Element.
int nextIndex(); // Returns the index of the next element.
E previous(); // Returns the previous Element
int previousIndex(); // Returns the index of the previous element.
}Using your ListIterator implementations, update your MyArrayList and MyLinkedList classes so that they implemement the *Iterable
List<Contact> list; // Use both your MyArrayList and MyLinkedList
for (Contact c: list) {
System.out.println(c);
}Please thoroughly test your code and briefly discuss your testing strategy. Make sure that you test the different sorting algorithms. Turn in all your test code.
The assignment is due on Friday at 11:55pm. You may turn it in early.