random organized array

Hi all,

I have a problem and I hope there is an easy solution for that.

I have a linear array of size N, the array just contains a zero or the number of the array element, someting like that {0,1,0,0,4,5,6,0,0,9} for a N=10 elements.

Now I would like to have a chaotic organization of the values, so the contrary part of what a sort algorithm does.

Is there an easy way to do it?

So....
http://www.cplusplus.com/reference/algorithm/next_permutation.html
And u might use a random function to set the number of permuting.
See also random_shuffle().

Topic archived. No new replies allowed.