Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public static void quicksort(int[] zahlen, int lo, int hi){
  2. int l = lo, u = hi;
  3. int pivot = zahlen[(lo + hi) / 2];
  4. int temp;
  5.  
  6. while (l <= u)
  7. {
  8. while (zahlen[l] < pivot)
  9. l++;
  10. while (zahlen[u] > pivot)
  11. u--;
  12. if (l <= u) {
  13. temp = zahlen[l];
  14. zahlen[l] = zahlen[u];
  15. zahlen[u] = temp;
  16. }
  17. }
  18.  
  19. if (lo < u) quicksort(zahlen, lo, u);
  20. if (l < hi) quicksort(zahlen, l, hi);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement