Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Permutations
Example 1: [1,2,3]
Example 2: [0,1]
Single element
Four elements
Custom
nums
=
[1, 2, 3]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
Step:
Start: Generate all permutations using backtracking
Variable
Value
nums
[1,2,3]
result
-
Depth
Function Call
1
permute([1,2,3])
0 / 80
Example 1: [1,2,3]
Example 2: [0,1]
Single element
Four elements
Custom
nums
=
[1, 2, 3]
0 / 80
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
Step:
Start: Generate all permutations using backtracking
Visualization
Variables