I'm trying to create a reverse ListIterator for a LinkedList, and was going to just implement it as a wrapper to linkedList.listIterator(linkedList.size()) that swaps the next and previous operations, but then realized that if LinkedList#listIterator(int) is implemented to just traverse forwards to the position specified, using it to start at the end would be terribly unoptimized, having to traverse the list twice rather than once, when the list supports going directly to the end. Is linkedList.listIterator(linkedList.size()) optimized to not traverse the entire list?
samedi 7 mars 2015
Is linkedList.listIterator(linkedList.size()) optimized?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire