// ver2. sorterer ogs? tall mellom 2**32 og 2**31 class SekvensiellRadix{ static void radix2(int [] a) { // 2 digit radixSort: a[] int max = a[0], numBit = 2, n =a.length; // a) finn max verdi i a[] for (int i = 1 ; i < n ; i++) if (a[i] > max) max = a[i]; while (max >= (1L<> shift) & mask]++; } // c) Add up in 'count' - accumulated values for (int i = 0; i <= mask; i++) { j = count[i]; count[i] = acumVal; acumVal += j; } // d) move numbers in sorted order a to b for (int i = 0; i < n; i++) { b[count[(a[i]>>shift) & mask]++] = a[i]; } }// end radixSort }