A linked list stores elements as nodes where each node points to the next. Unlike arrays, elements aren't contiguous in memory — insertion and deletion are O(1) at known positions (no shifting needed), but accessing the nth element requires traversing from the head: O(n).

How Linked List Works

Singly linked: each node has data + pointer to next. Doubly linked: each node also points to previous (enables reverse traversal). Used in: browser history (back/forward), undo systems, LRU caches, and as building blocks for stacks and queues.

Key Concepts

  • Node — Contains data and a pointer (reference) to the next node — the building block of linked lists
  • Head/Tail — Head is the first node; tail is the last node — traversal starts from the head
  • Singly vs Doubly — Singly: forward-only traversal. Doubly: bidirectional traversal — more memory but more flexible
  • O(1) Insertion/Deletion — Adding or removing at a known position doesn't require shifting other elements

Learn Linked List — Top Videos

Linked List Educators

Gate Smashers
Gate Smashers

@gatesmashers

Web Dev

Welcome to Gate Smashers, one of the fastest-growing EdTech communities with 2.6 M+ learners. 🎓 We provide complete lec...

2.7M Subs
2.1K Videos
13.8K Avg Views
1.58% Engagement
View Profile →
NeetCode
NeetCode

@neetcode

CS

Preparing for technical interviews? Checkout neetcode.io

1.1M Subs
421 Videos
131.1K Avg Views
3.97% Engagement
View Profile →
NeuralNine
NeuralNine

@neuralnine

AI Coding

NeuralNine is an educational brand focusing on programming, machine learning and computer science in general! Let's deve...

467K Subs
1K Videos
10.3K Avg Views
3.79% Engagement
View Profile →
Greg Hogg
Greg Hogg

@greghogg

Data Science

Today, Greg is driven by a single mission: to help engineers master the complex technical skills required to land roles ...

309K Subs
1.3K Videos
9.1K Avg Views
3.31% Engagement
View Profile →

Frequently Asked Questions

Array vs linked list?

Arrays for indexed access and iteration. Linked lists for frequent insertion/deletion at arbitrary positions. In practice, arrays (and dynamic arrays like ArrayList) are almost always faster due to CPU cache locality.

Want a structured learning path?

Plan a Linked List Lesson →