Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ArrayIndex
- {
- public static void Shuffle<T>(T[] arr)
- {
- Random rand = new Random();
- for (int i = 0; i < arr.Length - 1; i++)
- {
- int j = rand.Next(i, arr.Length);
- T temp = arr[i];
- arr[i] = arr[j];
- arr[j] = temp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement