All Permutations: Difference between revisions

From Algorithm Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:All Permutations (All Permutations)}} == Description == Generate all permuttaions of the characters/elements in a string/array. == Parameters == <pre>n: number of elements</pre> == Table of Algorithms == {| class="wikitable sortable" style="text-align:center;" width="100%" ! Name !! Year !! Time !! Space !! Approximation Factor !! Model !! Reference |- | Steinhaus–Johnson–Trotter algorithm (All Permutations All Permutations)|Steinhaus–J...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:
== Parameters ==  
== Parameters ==  


<pre>n: number of elements</pre>
$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})$ auxiliary || Exact || Deterministic || [https://www-ams-org.ezproxy.canberra.edu.au/journals/mcom/1963-17-083/S0025-5718-1963-0159764-2/home.html Time]
| [[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.ezproxy.canberra.edu.au/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)$ auxiliary || Exact || Deterministic || [https://mathscinet-ams-org.ezproxy.canberra.edu.au/mathscinet-getitem?mr=0080380 Time]
| [[Tompkins–Paige algorithm (All Permutations All Permutations)|Tompkins–Paige algorithm]] || 1956 || $O(n)$ on specific permutations || $O(n)$ || Exact || Deterministic || [https://mathscinet-ams-org.ezproxy.canberra.edu.au/mathscinet-getitem?mr=0080380 Time]
|-
|-
| [[Heap's algorithm (All Permutations All Permutations)|Heap's algorithm]] || 1963 || $O(n)$ per permutation || $O(n)$ auxiliary || Exact || Deterministic || [https://academic-oup-com.ezproxy.canberra.edu.au/comjnl/article/6/3/293/360213 Time]
| [[Heap's algorithm (All Permutations All Permutations)|Heap's algorithm]] || 1963 || $O(n)$ per permutation || $O(n)$ || Exact || Deterministic || [https://academic-oup-com.ezproxy.canberra.edu.au/comjnl/article/6/3/293/360213 Time]
|-
|-
|}
|}


== Time Complexity graph ==  
== Time Complexity Graph ==  


[[File:All Permutations - Time.png|1000px]]
[[File:All Permutations - Time.png|1000px]]
== Space Complexity graph ==
[[File:All Permutations - Space.png|1000px]]
== Pareto Decades graph ==
[[File:All Permutations - Pareto Frontier.png|1000px]]

Latest revision as of 10:07, 28 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

Time Complexity Graph

All Permutations - Time.png