Program is to implement the Johnson-Trotter algorithm for generating permutations. It is to read in a number n and generate all permutations of length n. It shouldprint out the numbers in each permutation along with the “direction” of each number. You may use the characters “L” and “R” or the numbers 1 and -1 to indicate thedirections.
Are there any questions left?
New questions in the section Engineering
-
Engineering 2022-05-15 19:04:59