@@ -0,0 +1,1036 @@
+import java.util.Arrays;%0Aimport java.util.Random;%0A%0A/**%0A * Fisher%E2%80%93Yates shuffle algorithm.%0A * %0A * @author Atom%0A *%0A */%0Apublic class FisherYatesShuffle %7B%0A%0A%09/**%0A%09 * Modern version (Richard Durstenfeld) of the Fisher%E2%80%93Yates shuffle algorithm.%0A%09 * %0A%09 * @param arr generic array%0A%09 * @see %3Ca href=%22https://en.wikipedia.org/wiki/Fisher-Yates_shuffle%22%3EFisher%E2%80%93Yates shuffle%3C/a%3E%0A%09 */%0A%09public static %3CT%3E void shuffle(T%5B%5D arr) %7B%0A%09%09Random rnd = new Random();%0A%09%09for (int i = arr.length - 1; i %3E 0; i--) %7B%0A%09%09%09int randomPos = rnd.nextInt(i + 1);%0A%09%09%09if (randomPos != i) %7B%0A%09%09%09%09T tmp = arr%5BrandomPos%5D;%0A%09%09%09%09arr%5BrandomPos%5D = arr%5Bi%5D;%0A%09%09%09%09arr%5Bi%5D = tmp;%09%09%09%09%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Integer%5B%5D i = %7B 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 %7D;%0A%09%09String%5B%5D s = %7B %22mon%22, %22Tue%22, %22wed%22, %22thu%22, %22fri%22, %22sat%22, %22sun%22 %7D;%0A%09%09Character%5B%5D c = %7B 'A', 'B', 'C', 'D', 'E', 'F', 'G' %7D;%0A%09%09shuffle(i);%0A%09%09shuffle(s);%0A%09%09shuffle(c);%0A%09%09System.out.println(Arrays.toString(i));%0A%09%09System.out.println(Arrays.toString(s));%0A%09%09System.out.println(Arrays.toString(c));%0A%09%7D%0A%0A%7D%0A

Create FisherYatesShuffle.java