Suggest an editImprove this articleRefine the answer for “How does a linked list differ from an array?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A linked list and an array are both data structures for storing a set of elements, but they are **fundamentally organized differently**. The key difference: an **array stores elements sequentially**, while a **list is connected through a chain of references**. **Key point:** an array is faster for frequent access to random elements, while a list is better when elements need to be added and removed frequently.Shown above the full answer for quick recall.Answer (EN)ImageA linked list and an array are both data structures for storing a set of elements, but they are **fundamentally organized differently**. The key difference: an **array stores elements sequentially**, while a **list is connected through a chain of references**. --- ### **1. Placement in memory** | Characteristic | **Array** | **Linked list** | |---|---|---| | Storing elements | In **contiguous memory cells** | In **different places in memory**, connected by references | | Structure | `[1][2][3][4]` | `[1 | | Next element | Determined by index | Determined by a reference (`next`) | --- ### **2. Accessing elements** | Operation | Array | Linked list | |---|---|---| | Access by index | **O(1)** - instant (address is computed) | **O(n)** - need to walk from the start to the target element | | Search by value | **O(n)** | **O(n)** | **Conclusion:** an array is faster for frequent access to random elements. --- ### **3. Insertion and deletion** | Operation | Array | Linked list | |---|---|---| | Insertion/deletion in the middle | **O(n)** - elements need to be shifted | **O(1)** - it is enough to reassign references | | Insertion at the end | O(1) or O(n) (depends on the implementation) | O(1), if there is a reference to tail | **Conclusion:** a list is better when elements need to be added and removed frequently. --- ### **4. Size** | Parameter | Array | Linked list | |---|---|---| | Size | Fixed (in classic arrays) | Changes dynamically | | Memory | Economical | Requires more (to store references) | --- ### **5. Practical difference** - An **array** is convenient when **access speed** and **memory predictability** matter. - A **list** is convenient when **flexibility**, **dynamic size change**, and **frequent insertions/deletions** matter. --- **Summary:** > An **array** is a fast structure for storing elements sequentially and accessing them quickly. > A **linked list** is a flexible structure for dynamic data, where insertion and deletion operations matter, but access is slower.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.