I wrote two generic class to implement these two algorithms, so you can use these classes to generate permutations and combinations for some use, such as software testing.
Using the Code:
output:
10 Combinations of Array "1,2,3,4,5":
Download the Source Project:
1,2,3
1,2,4
1,2,5
1,3,4
1,3,5
1,4,5
2,3,4
2,3,5
2,4,5
3,4,5
24 Permutations of Array "dog,cat,bird,bat":
dog,cat,bird,bat
dog,cat,bat,bird
dog,bird,cat,bat
dog,bat,cat,bird
dog,bird,bat,cat
dog,bat,bird,cat
cat,dog,bird,bat
cat,dog,bat,bird
bird,dog,cat,bat
bat,dog,cat,bird
bird,dog,bat,cat
bat,dog,bird,cat
cat,bird,dog,bat
cat,bat,dog,bird
bird,cat,dog,bat
bat,cat,dog,bird
bird,bat,dog,cat
bat,bird,dog,cat
cat,bird,bat,dog
cat,bat,bird,dog
bird,cat,bat,dog
bat,cat,bird,dog
bird,bat,cat,dog
bat,bird,cat,dog
https://files.cnblogs.com/Dah/PermutationCombination.rar
Note: If you find any bug or have some suggestion, please send E-Mail to me or leave your comments here, thanks!