Permutations!

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.

a + permute("bc") = abc & acb
b + permute("ac") = bac & bca
c + permute("ab") = cab & cba

There by generating all the permutations.
Source Code..

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..

abc

a
ab, ba
abc,acb,cab,bac,bca,cba

Source Code..

Comments

reg: The source code for the minimal change algorithm

Hello,
I have noticed that when i look for the minimal change algorithm source code,by clicking the link which says source code, it is taking me to a page which says page not found. could anybody please help me out with this, i need the code urgently

Regards,
Sameer

Source Code for Minimal Change Method.

Can I get the source code for minimal change method. I think the source code page is no longer available.

Right click and save as must do the job..

Right click and save as must do the job..