Advertisement
Aldin-SXR

private quick sort()

Apr 8th, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. /* Recursive quick sort logic */
  2. private static void sort(int[] elements, int low, int high) {
  3.     if (high <= low) {                              // 1
  4.         return;                                     // 1
  5.     }
  6.     int j = partition(elements, low, high);         // 2
  7.     sort(elements, low, j - 1);                     // 3
  8.     sort(elements, j + 1, high);                    // 3
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement