All Permutations: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
== Parameters == | == Parameters == | ||
n: number of elements | $n$: number of elements | ||
== Table of Algorithms == | == Table of Algorithms == | ||
Line 16: | Line 16: | ||
|- | |- | ||
| [[Steinhaus–Johnson–Trotter algorithm (All Permutations All Permutations)|Steinhaus–Johnson–Trotter algorithm]] || 1963 || $O(n)$ on specific permutations || $O({1})$ | | [[Steinhaus–Johnson–Trotter algorithm (All Permutations All Permutations)|Steinhaus–Johnson–Trotter algorithm]] || 1963 || $O(n)$ on specific permutations || $O({1})$ || Exact || Deterministic || [https://www.ams.org/journals/mcom/1963-17-083/S0025-5718-1963-0159764-2/home.html Time] | ||
|- | |- | ||
| [[Tompkins–Paige algorithm (All Permutations All Permutations)|Tompkins–Paige algorithm]] || 1956 || $O(n)$ on specific permutations || $O(n)$ | | [[Tompkins–Paige algorithm (All Permutations All Permutations)|Tompkins–Paige algorithm]] || 1956 || $O(n)$ on specific permutations || $O(n)$ || Exact || Deterministic || [https://mathscinet.ams.org/mathscinet-getitem?mr=0080380 Time] | ||
|- | |- | ||
| [[Heap's algorithm (All Permutations All Permutations)|Heap's algorithm]] || 1963 || $O(n)$ per permutation || $O(n)$ | | [[Heap's algorithm (All Permutations All Permutations)|Heap's algorithm]] || 1963 || $O(n)$ per permutation || $O(n)$ || Exact || Deterministic || [https://academic.oup.com/comjnl/article/6/3/293/360213 Time] | ||
|- | |- | ||
|} | |} |
Revision as of 07:52, 10 April 2023
Description
Generate all permuttaions of the characters/elements in a string/array.
Parameters
$n$: number of elements
Table of Algorithms
Name | Year | Time | Space | Approximation Factor | Model | Reference |
---|---|---|---|---|---|---|
Steinhaus–Johnson–Trotter algorithm | 1963 | $O(n)$ on specific permutations | $O({1})$ | Exact | Deterministic | Time |
Tompkins–Paige algorithm | 1956 | $O(n)$ on specific permutations | $O(n)$ | Exact | Deterministic | Time |
Heap's algorithm | 1963 | $O(n)$ per permutation | $O(n)$ | Exact | Deterministic | Time |