开始之前 后面会用到的静态函数 比较compare函数和交换exchange的函数以及随机打乱的shuffle函数: private static int compare(Comparable v, Comparable w) { return v.compareTo(w); } private static void exchange(Comparable[] a, int i, int j) { Comparable t = a[i]; a[i] = a[j]; a[j] = t; } public stati…