daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void quicksort_iteration (double * a, int first, int last) //Итерация быстрой сортировки
  2. {
  3.     int i = first, j = last;
  4.     double x = a[(first + last) / 2];
  5.     while (i <= j)
  6.     {
  7.         while (cmp(a[i], x) == -1) i++;
  8.         while (cmp(a[j], x) == 1) j--;
  9.         if (i <= j)
  10.         {
  11.             if (i < j) swp (a + i, a + j);
  12.             i++;
  13.             j--;
  14.         }
  15.     }
  16.     if (i < last) quicksort_iteration(a, i, last);
  17.     if (first < j) quicksort_iteration(a, first,j);
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top