The Steinhaus-Johnson-Trotter algorithm, also called the Johnson-Trotter algorithm or plain changes, is an algorithm named after Hugo Steinhaus, Selmer M. Johnson and Hale F. Trotter that generates all permutations of n elements so that each two adjacent permutations in the resulting sequence differ by swapping two adjacent elements. The method was already known to seventeenth century English change ringers, and Robert Sedgewick called it perhaps the most prominent permutation enumeration algorithm; a version can be implemented so that the average time per permutation is constant.
Facts
Time Complexity
Time Complexity (category)Factorial Time -- O(n!) 1 Classification
Design Technique Connections
In Field
Source Steinhaus-Johnson-Trotter algorithm (Wikipedia)
Uses Design Technique
Sources
1. Steinhaus-Johnson-Trotter Algorithm (Wikipedia)
Wikipedia infobox: time complexity factorialQuote, Wikipedia infobox: time complexity factorial
factorial
View the Source Steinhaus-Johnson-Trotter algorithm (Wikipedia)
- In Field: Algorithms and Complexity Theory, Lead paragraph
In Group: Shuffling and Permutation Generation Algorithms, Lead section
Each two adjacent permutations in the resulting sequence differ by swapping two adjacent permuted elements.
View the SourceReader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.