Apart from Johnson trotter, Permutations can be generated in many ways. The two methods i'll be discussing here are :
1. Recursive Method
2. Minimal Change Method or Bottom up approach.
1. Recursive Method
In this method, we take out a character at position 'I' and permute the rest of the string recursively. It goes something like this.. Lets say
"abc" is the string.
There by generating all the permutations.
2. Minimal Change Method or Bottom up approach.
In this method, we start from a single character, append a new character and rotate the newly appended character covering all positions in the string. Like this..