← All problems

Reverse Linked List

Easy linked listspointers LeetCode ↗
Reverse a singly linked list. Implement it iteratively first, then recursively, and be able to explain the pointer manipulation and the recursion's base case in an interview.

Hints (0/3 revealed)

Log in to reveal hints progressively.

Complexity

Time O(n), Space O(1) iterative / O(n) recursive

Common pitfalls

  • Losing the next pointer before flipping
  • Wrong base case in recursion

Your solution

Log in to save your code and track progress.