Tap here to switch tabs
Problem
Submissions
Solution

Solution: Reverse Linked List II

Statement

Naive approach

The naive approach uses two pointers left and right to keep track of the sublist and reverse it. The pointers left and right are intialized to the head of the linked list.

We begin by moving the left pointer to the mthm^{th} ...

Tap here to switch tabs
Problem
Submissions
Solution

Solution: Reverse Linked List II

Statement

Naive approach

The naive approach uses two pointers left and right to keep track of the sublist and reverse it. The pointers left and right are intialized to the head of the linked list.

We begin by moving the left pointer to the mthm^{th} ...