Roadmap › Stage 5: Recursion & Linked Lists › Pattern 24 of 53
DSA pattern guide

Linked List — Reversal

Reverse all, part, or groups of a list, palindrome list.

Stage 5 · Recursion & Linked Lists7 problems2 Easy · 4 Medium · 1 Hard

Use it when

Reverse all, part, or groups of a list, palindrome list.

Key idea

Keep prev, curr and next. Flip curr.next to prev and step forward. For sublists, reconnect both ends.

Practice problems, in order

  1. Reverse a Linked ListEasy
  2. Palindrome Linked ListEasy
  3. Reverse Linked List IIMedium
  4. Maximum Twin Sum of a Linked ListMedium
  5. Swap Nodes in PairsMedium
  6. Rotate ListMedium
  7. Reverse Nodes in k-GroupHard

How to practise this pattern

  1. Read the problem and look for the signal above before writing any code.
  2. Say the brute force out loud, with its time complexity, then ask what work it repeats.
  3. Apply the key idea and write the optimised version yourself.
  4. If you're stuck for more than 10 minutes, take one small hint, not the full solution.
  5. Move to the next problem only when you can explain why this pattern fits.

Stuck on one of these?

The AlgoSolveo extension (free, launching soon) sits beside the LeetCode problem and gives the smallest hint that gets you moving, never the full answer. Solved problems tick off on your roadmap.

Join the extension waitlistTrack it on the roadmap
← Previous patternLinked List — Basics & Fast/SlowNext pattern →Linked List — Merge & Sort