Browse Curriculum

The Linked List Pattern

Pointer manipulation with no random access. Almost every linked list technique is one of three moves: run two pointers at different speeds, reverse a section in place, or use a dummy head so the first node needs no special case.

6
Interactive problems
6
Free to open

How to recognise a linked list problem

The input is a list rather than an array, and the question asks about cycles, the nth node from the end, reordering, or comparing the list against itself. The giveaway constraint is "do it in one pass" or "use O(1) extra space" — both rule out copying into an array.

Time and space complexity

O(n) time and O(1) extra space for the pointer techniques. Copying into an array also gives O(n) time but costs O(n) space, which is usually the thing being tested.

Linked List practice problems

Each problem pairs a worked explanation with an interactive visualizer you step through yourself, plus the implementation in JavaScript, Python, Java and C++.


Related patterns and concepts

The underlying technique is covered from first principles in the linked list lesson in the DSA visualizer curriculum. Linked List is one of the 16 coding interview patterns, and its problems also appear in the DSA 75 interview sprint.