public class Util
{
public static List
{
List
//list.CopyTo(retList.ToArray(), 0);
Random random = new Random();
for (int i = 0; i < list.Count; i++)
{
int swapIndex = random.Next(i, list.Count);
if (swapIndex != i)
{
T temp = retList[i];
retList[i] = retList[swapIndex];
retList[swapIndex] = temp;
}
}
return retList;
}
}
No comments:
Post a Comment