Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void quicksort(int[] zahlen, int lo, int hi){
- int l = lo, u = hi;
- int pivot = zahlen[(lo + hi) / 2];
- int temp;
- while (l <= u)
- {
- while (zahlen[l] < pivot)
- l++;
- while (zahlen[u] > pivot)
- u--;
- if (l <= u) {
- temp = zahlen[l];
- zahlen[l] = zahlen[u];
- zahlen[u] = temp;
- }
- }
- if (lo < u) quicksort(zahlen, lo, u);
- if (l < hi) quicksort(zahlen, l, hi);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement