Steinhaus–Johnson–Trotter algorithm (All Permutations All Permutations)
Jump to navigation
Jump to search
Time Complexity
$O(n)$ on specific permutations
Space Complexity
$O({1})$ words
(Determining $x_i$ and $y_i$ each iteration can be done in constant space)
Description
Approximate?
Exact
Randomized?
No, deterministic
Model of Computation
Word RAM
Year
1963