Quicksort

<source lang="java"> void quicksort(int a[], int lo0, int hi0) { int lo = lo0; int hi = hi0; int mid;

       if (hi0 > lo0) {

mid = a[(lo0 + hi0) / 2]; while (lo <= hi) { while ((lo < hi0) && (a[lo] < mid)) { ++lo; } while ((hi > lo0) && (a[hi] > mid)) { --hi; } if (lo <= hi) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T;

               		++lo;

--hi; } } if (lo0 < hi) { quicksort(a, lo0, hi); } if (lo < hi0) { quicksort(a, lo, hi0); } } } </source>