Skip to content
BENIBIX Learn

Array vs Linked List

An array keeps its items side by side in memory, so reading any one is instant. A linked list joins items with pointers. Changes in the middle are quick, but reading is slow.

Development🧩 Programming Concepts

Array

A row of values kept together under one name. Each sits in a numbered spot.

An array is one value that holds many values in a row. Each item sits in a numbered spot, and the count starts at zero. You can add items, take them out, sort them or go through them one by one. Python calls its array a list. Arrays are the most common way to keep many things of the same kind together.

Example
A to-do app keeps Lucy's tasks in an array. Item 0 is buy milk, item 1 is call Jack.
Why it matters
Programs rarely deal with just one thing. Lists of users, songs and orders are all arrays.
Full entry
Development🧮 Algorithms & Data Structures

Linked List

A chain of items. Each one holds a value and points to the next.

A linked list is a chain of items that point to each other in a line. Each item holds a value and a pointer to the next one. The items do not sit side by side in memory; the pointers join them. Adding or removing an item in the middle is fast, because you only change two pointers. Reaching the 500th item is slow, because you must follow 499 pointers. A doubly linked list also points back to the item before.

Example
Jack's music app keeps the play queue as a linked list. Dropping a song from the middle just links its two neighbours together.
Why it matters
It shows the trade in every data structure. Fast changes in one place cost slow reads in another.
Full entry

In one line

Array
A row of values kept together under one name. Each sits in a numbered spot.
Linked List
A chain of items. Each one holds a value and points to the next.