Domanda di colloquio di Amazon

What is the difference between arrays and linked lists?

Risposta di colloquio

Anonimo

28 set 2011

Arrays have O(1) access.. You have to traverse a LL to get to an element. Easier to add a new element in LL (variable size). arrays are usually fixed length, if you try to realloc (it will copy all elements.. expensive!)