P
Philipp Brune
I am searching for an algorithm to generate permutations of integers
in c#. It is a special case where those integers are in the range
[0..n].This is not a homework assignment, i am just wondering how it
can be done as fast as possible. I know, i can take the array and
rotate subarrays to recursively to get my permutations but since the
numbers are integers i imagine this it could be done with integer
arithmetics instead of shuffeling data. Somehow it smells like the
% operator, but i have no idea how to implement it.
Does anybody now of an algorithm for this problem ?
Many thanks in advance,
Philipp
in c#. It is a special case where those integers are in the range
[0..n].This is not a homework assignment, i am just wondering how it
can be done as fast as possible. I know, i can take the array and
rotate subarrays to recursively to get my permutations but since the
numbers are integers i imagine this it could be done with integer
arithmetics instead of shuffeling data. Somehow it smells like the
% operator, but i have no idea how to implement it.
Does anybody now of an algorithm for this problem ?
Many thanks in advance,
Philipp