Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void qSort(char* v[], int left, int right) {
- int last = 0;
- int counter = 0;
- if (left >= right)
- return ;
- swap(v, left, (left + right) / 2);
- last = left;
- for (counter = left + 1; counter <= right; counter++) {
- if (strcmp(v[counter], v[left]) < 0) {
- swap(v, counter, ++last);
- }
- }
- swap(v, left, last);
- qSort(v, left, last - 1);
- qSort(v, last + 1, right);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement