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

From Algorithm Wiki
Revision as of 08:40, 10 April 2023 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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