Begin Algo
Data structures · 5 lessons

Linked ListNodes joined by pointers

A linked list gives up contiguous memory in exchange for O(1) insertion and deletion at a known position. You will not reach for one often, but the pointer intuition, the fast/slow trick, and its role behind LRU caches and trees make it worth the detour.

Why learn Linked List

Where it shows up
Back and forward in a browser

Each page remembering the one before and the one after is a doubly linked list. So are playlists and an editor's undo/redo.

→ Lesson: Doubly Linked List
LRU caches

Move what was just used to the front, drop what has gone stale off the back. Paired with a hash table that is O(1). OS page replacement and CDN caches both work this way.

→ Lesson: Fast & Slow Pointers
Detecting a cycle

Two runners on a track, one twice as fast — if there is a loop they must meet. The same trick finds the middle of a list, and needs no extra memory.

→ Lesson: Fast & Slow Pointers

Lessons

5 lessons