Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void quick(int *temp, int i, int j)
- {
- int c, x, t=0;
- m=i; k=j;
- c=temp[(m+k) / 2];
- do{
- while (temp[m] < c) m++;
- while (temp[k] > c) k--;
- if (m <= k)
- {
- if(m!=k) NazQuick++;
- x=temp[m];
- temp[m]=temp[k];
- temp[k]=x;
- m++;
- k--;
- }
- t++;
- } while (m < k);
- if (i<k) quick(temp, i, k);
- if (m<j) quick(temp, m, j);
- }
- while (temp[m] < c) m++;
- while (temp[k] > c) k--;
- x=temp[m];
- temp[m]=temp[k];
- temp[k]=x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement