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
Line 6: Line 6:
== Parameters ==  
== Parameters ==  


<pre>n: number of elements</pre>
n: number of elements


== Table of Algorithms ==  
== Table of Algorithms ==  

Revision as of 12:02, 15 February 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})$ auxiliary Exact Deterministic Time
Tompkins–Paige algorithm 1956 $O(n)$ on specific permutations $O(n)$ auxiliary Exact Deterministic Time
Heap's algorithm 1963 $O(n)$ per permutation $O(n)$ auxiliary Exact Deterministic Time

Time Complexity graph

All Permutations - Time.png

Space Complexity graph

All Permutations - Space.png

Pareto Decades graph

All Permutations - Pareto Frontier.png