1void shuffle(int [] arr) {
2 for (int i = 0; i < arr.length; i++) {
3 int index = (int) (Math.random() * arr.length);
4 int temp = arr[i];
5 arr[i] = arr[index];
6 arr[index] = temp;
7 }
8 }