private static <T extends Comparable<T>>int randomizedPartition(List<T> a,int lower,int upper){
  int i=lower + RANDOM.nextInt(upper - lower + 1);
  exchange(a,upper,i);
  return partition(a,lower,upper);
}

private static < T extends Comparable < T > > int randomizedPartition ( List < T > a , int lower , int upper ) { int i = lower + RANDOM . nextInt ( upper - lower + 1 ) ; exchange ( a , upper , i ) ; return partition ( a , lower , upper ) ; }
rearranges an array in two partitions using random sampling . the array is permuted so that the elements of the lower partition are always smaller than those of the upper partition .
