public static int[] randPermute(int floor,int ceil){
  int[] permute=new int[ceil - floor];
  Random randi=new Random();
  for (int i=floor; i < ceil; i++) {
    int j=randi.nextInt(i - floor + 1);
    if (j != i - floor) {
      permute[i - floor]=permute[j];
    }
    permute[j]=i;
  }
  return permute;
}

public static int [ ] randPermute ( int floor , int ceil ) { int [ ] permute = new int [ ceil - floor ] ; Random randi = new Random ( ) ; for ( int i = floor ; i < ceil ; i ++ ) { int j = randi . nextInt ( i - floor + 1 ) ; if ( j != i - floor ) { permute [ i - floor ] = permute [ j ] ; } permute [ j ] = i ; } return permute ; }
returns a random permutation of all the integers between floor ( inclusive ) and ceil ( exclusive ) .
