Last Minute Notes
Github
Docs
Learn
Search
⌘
K
@sayanstwt
Lessons
Learn
/
Data Structures & Algorithms
/
Linked Lists
In-Place List Reversal
6 min
Beginner
7 steps
Flip next pointers with prev, curr and next.
List
1 → ... → 5
Copy to array
O(n) space
Goal
O(1) space
null
1
2
3
4
5
null
head
reverse it without copying the values anywhere
current
visited
done
In this lesson
Step 1 of 7
1
The problem
2
Three refs
3
One step
4
Full run
5
Save first
6
Sublist
7
Recap