Pergunta de entrevista da empresa Amazon

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

Resposta da entrevista

Sigiloso

10 de jun. de 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.