// Random Permutation // import java.util.Random; public class Program4 { public static void main(String[] args) { int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9}; Random generator=new Random(); for(int i=a.length-1; i>0; i--) { // pick a random index r in [0, i-1] int r=generator.nextInt(i); //Swap a[r] with a[i] (the last number in the unpermuted part of the array) int temp=a[i]; a[i]=a[r]; a[r]=temp; } // Print the reshuffled array for(int i=0; i