Computing the Ranks
public static void rank(Comparable [] a, int [] r) {
throw new IllegalArgumentException
("Rank array too short");
for (int i = 0; i < a.length; i++) r[i] = 0;
for (int i = 1; i < a.length; i++) {
for (int j = 0; j < i; j++)
if (a[j].compareTo(a[i])) <= 0) r[i]++;