Exemple #1
0
 private void quickSort(int left, int right) {
   if (right > left) {
     Object o1 = elementAt(right);
     int i = left - 1;
     int j = right;
     while (true) {
       while (compare.lessThan(elementAt(++i), o1)) ;
       while (j > 0) if (compare.lessThanOrEqual(elementAt(--j), o1)) break; // out of while
       if (i >= j) break;
       swap(i, j);
     }
     swap(i, right);
     quickSort(left, i - 1);
     quickSort(i + 1, right);
   }
 }