Steinhaus–Johnson–Trotter algorithm (All Permutations All Permutations)

From Algorithm Wiki
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

Reference

https://www.ams.org/journals/mcom/1963-17-083/S0025-5718-1963-0159764-2/home.html