How do I calculate all possible permutations of an array of length n?(adsbygoogle = window.adsbygoogle || []).push({});

If I draw on a paper, I can do myself permutations of 3 or 4 length arrays.

However, I want an algorithm to calculate all possible permutation. And calculate it as fast as possible.

Do you know how to do it?

I would appreciate any help.

Thanks.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Permutation calculation

**Physics Forums | Science Articles, Homework Help, Discussion**