Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Swap Nodes in Pairs
Bookmark
Input
Even length
Odd length
Single node
Empty list
Three pairs
Custom
values
=
[1, 2, 3, 4]
1
2
3
4
algo
master
.
io
Step:
Start of algorithm
Variable
Value
values
[1,2,3,4]
head
"Node(1)"
dummy
-
Variable
Value
prev
-
first
-
second
-
0 / 12
Input
Even length
Odd length
Single node
Empty list
Three pairs
Custom
values
=
[1, 2, 3, 4]
0 / 12
1
2
3
4
algo
master
.
io
Step:
Start of algorithm
Visualization
Variables