Britannica Sources used in this answer

How does a linked list differ from an array?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In computer science, arrays and linked lists are distinct data structures used for organizing and storing information.

An array is a linear structure where elements are stored in contiguous memory locations. These elements are identified by consecutive integers, allowing for direct access to any item using its index number.1

A linked list differs by storing data items nonconsecutively in memory. Instead of relying on numerical indices, the elements are connected using pointers—memory addresses stored alongside each item that indicate the location of the next element in the sequence.1

While arrays are efficient for accessing elements by position, linked lists provide a flexible way to manage data that may be scattered throughout memory, as each node explicitly points to the next, maintaining the logical order of the collection.1