I have a linked list and I need to make method that returns an iterator at a given point in the list. I currently have an iterator that starts at the head:
p
So I ended up going with this.
public Iterator iterator(int x){ Iterator it = new ListIterator(); for (; x > 0; --x){ it.next(); } return it; }
Given more range I might have added a constructor but without being able to change much this worked the best.