Linked Lists are one of those data structures everyone learns, everyone complains about and folds a good amount of candidates.
Linked Lists are rarely used directly. Instead, they show up as building blocks for higher‑level data structures like stacks, queues, and deques. In this guide, we’ll teach you everything you nee to know about linked lists.
What Is a Linked List?
A Linked List is a data structure that represents a sequence of nodes.
Each node:
Stores data
Stores a pointer to another node
Unlike arrays, a linked list:
❌ Does not allocate a contiguous block of memory
❌ Does not support direct indexing
That one fact — no contiguous memory — explains almost every property of linked lists.
There are two main variations you’ll see:
Singly Linked List – each node points to the next
Doubly Linked List – each node points to both the next and previous node
How to Visualize a Linked List
The cleanest way to think about linked lists is with sentinel (dummy) nodes.
We usually add:
A sentinel head
A sentinel tail
These nodes don’t store real data. Their job is to simplify logic by removing edge cases like:
“What if the list is empty?”
“What if I’m inserting the first element?”
“What if I’m deleting the last element?”
With sentinels, every real node always has a previous and/or next pointer.