Skip to main content
All Visualizers
#LC 206•Linked List•Easy

Reverse Linked List

Reverse a singly linked list and return its new head.

Understand the problem

Reverse a singly linked list and return its new head.

Example 1

Input: {"head": [1, 2, 3]}

Output: [3, 2, 1]

Follow the trace to see how the algorithm reaches this result.

Constraints

  • Use the input format shown in the example.
Think first

What information should you keep so you can solve the next step efficiently?

Pattern tags:Linked listPointer reversal
Time: O(n)Space: O(1)
Step 1 of 5 • Use Left/Right arrows or Space to control