LC 206
LeetCode 206 · Easy

Reverse Linked List

Reverse a singly linked list.

Linked list → · Very high frequency · Solve on LeetCode →

Try it

Step through the core mechanic. The simulator below runs the linked list shape this problem is built on.

Walk the pattern

No dedicated step-through for this one yet. The shape is Linked list — its pattern page has the interactive walkthrough, the reference implementation, and a five-problem progression that this problem sits inside.

The approach

Walk with prev/curr; each step save next, point curr.next back to prev, advance both. prev ends on the new head. The iterative version is O(1) space.

AspectValue
PatternLinked list
Recognise it byFlip the direction of next pointers.
Time complexityO(n)
Space complexityO(1)
DifficultyEasy

Who asks it

Companies known to ask this problem, from public LeetCode company-tag aggregations. A signal of where to expect it, not a guarantee.