SHARE
TWEET

qs

a guest Apr 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void szybkie(int *tablica, int d, int g)
  2. {
  3.     if (d < g)
  4.     {
  5.         int t = tablica[d];
  6.         int s = d;
  7.         for (int i = d + 1;i < g;i++)
  8.         {
  9.             if (tablica[i] < t)
  10.             {
  11.                 s = s + 1;
  12.                 swap(tablica[s], tablica[i]);
  13.             }
  14.         }
  15.         swap(tablica[d], tablica[s]);
  16.         szybkie(tablica, d, s );
  17.         szybkie(tablica, s + 1, g);
  18.  
  19.     }
  20. }
  21. void qs(int* tablica, int rozmiar)
  22. {
  23.     szybkie(tablica, 0, rozmiar);
  24. }
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