Sitemap

Member-only story

Day 21 — Reverse Linked List | Blind 75 | Java

4 min readAug 18, 2026

--

Today’s problem is LeetCode 206 — Reverse Linked List.

Reversing a linked list is one of the most fundamental linked-list problems in coding interviews. It helps build a strong understanding of how next pointers work and introduces two important techniques:

  1. Iterative reversal using pointers
  2. Recursive reversal

I also explored a straightforward approach using an extra ArrayList.

Press enter or click to view image in full size
https://leetcode.com/problems/reverse-linked-list/description/

Approach 1: Using Extra Space

The simplest approach is to first store all node values in an ArrayList.

We then traverse the linked list again and replace each node’s value with the values from the list in reverse order.

For example:

1 → 2 → 3 → 4 → 5

The values are stored as:

[1, 2, 3, 4, 5]

Then we write them back in reverse:

5 → 4 → 3 → 2 → 1

This approach is easy to understand, but it does not actually reverse the links. Instead, it changes the values stored inside the existing nodes.

Java Code

class Solution {
public ListNode reverseList(ListNode head) {
List<Integer>…

--

--

Priyanka
Priyanka

Written by Priyanka

Software developer sharing practical insights on development & modern technology. Writing about concepts, lessons learned & real-world development experiences.