Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Reverse Linked List II
Bookmark
Extract & Reverse
In-Place
Input
Example 1
Single Node
Full Reversal
Middle Section
Custom
values
=
[1, 2, 3, 4, 5]
,
m
=
2
,
n
=
4
0
dummy
1
2
3
4
5
head
0
dummy
1
2
3
4
5
head
0
dummy
1
2
3
4
5
head
0
dummy
1
2
3
4
5
head
pre
0
dummy
1
2
3
4
5
head
pre
curr
0
dummy
1
2
3
4
5
head
pre
curr
0
dummy
1
2
3
4
5
head
pre
curr
0
dummy
1
2
3
4
5
head
pre
curr
0
dummy
1
4
3
4
5
head
pre
curr
0
dummy
1
4
3
2
5
head
pre
curr
0
dummy
1
4
3
2
5
head
algo
master
.
io
Step:
Start: reverse the sublist between positions m and n
0 / 11
Input
Example 1
Single Node
Full Reversal
Middle Section
Custom
values
=
[1, 2, 3, 4, 5]
,
m
=
2
,
n
=
4
0 / 11
algo
master
.
io
Step:
Start: reverse the sublist between positions m and n