0

I want to do permutation of 10 elements (values) array in PHP. I tried to modify bubble sort algorithm, but I think it's doesn't efficient way to do that. All of permutations should be 10!. Thank you in advance for any help.

For exmaple:

{0,1,3...}
{0,3,1...}
{1,0,3...}
{1,3,0...}
{3,1,0...}
{3,0,1...}
  • Welcome to SO! What have you tried so far? To help us help you, please add a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – ti7 Feb 07 '17 at 02:45
  • Possible duplicate of [Permutations - all possible sets of numbers](http://stackoverflow.com/questions/5506888/permutations-all-possible-sets-of-numbers) – mickmackusa Mar 13 '17 at 00:10

0 Answers0