Domanda di colloquio di Amazon

Why would you choose an ArrayList() over a LinkedList()

Risposta di colloquio

Anonimo

10 giu 2011

ArrayList if you need to grab nth element (random access). With linked list, you need to iterate through. LinkedList if you will be inserting elements between other elements. With arrayList, adding elements inbetween forces a "copy" of the array to be made.