Pergunta de entrevista da empresa Amazon

What is the difference between arrays and linked lists?

Resposta da entrevista

Sigiloso

28 de set. de 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!)