OK, so why does the iterator of a LinkedList perform better than the iterator of an ArrayList? The LinkedList uses its own ListIterator when you run iterator(). Here is the next method:
The ArrayList uses the default iterator implementation of the AbstractList. Here is that iterator's next method:
The next() method is using the get(index) method so I will include that too:
RangeCheck is interesting because it violates the
Java naming standard. Other than that it is simple enough:
It appears to me that the only real difference is that the ArrayList wraps its code in a try-catch and the LinkedList doesn't. I don't see any other reason that the LinkedList should be faster using an iterator.