I need to randomly \'sort\' a list of integers (0-1999) in the most efficient way possible. Any ideas?
Currently, I am doing something like this:
bo
what about :
System.Array.Sort(arrayinstance, RandomizerMethod);
...
//any evoluated random class could do it !
private static readonly System.Random Randomizer = new System.Random();
private static int RandomizerMethod(T x, T y)
where T : IComparable
{
if (x.CompareTo(y) == 0)
return 0;
return Randomizer.Next().CompareTo(Randomizer.Next());
}
voila!