So I’ve implemented a single linked, linked list which extends generic type AbstractSequentialList. I’m overriding the listIterator method, so have made a new class that implements generic type ListIterator which gets instantiated in the listIterator method of my linked list class. I have a few questions:
- The listIterator method that I override needs an int parameter, what is the purpose of this? Do I go to that index of the list and pass that node through to the instantiated ListIterator?
- Does the index always start at 0 for the ListIterator, even if I’m starting to iterate from a node in the middle of the list?
- In the ListIterator class how do I write the hasPrevious and Previous method if the list is singly linked?