Question d’entretien chez Amazon

When do you use an array versus a linked list?

Réponses aux questions d'entretien

Utilisateur anonyme

19 févr. 2012

Arrays are fixed in size. While linked list is dynamic. So when we don't know the size of the content in advance then we should use Linked List.

Utilisateur anonyme

22 mars 2012

arrays also support indexed access to any element in O(1) time. LinkedLists would be O(n). LinkedLists work well if you need FIFO or LIFO behavior. Arrays take a little more bookkeeping to support these ops.