We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13e099e commit caaff38Copy full SHA for caaff38
quickSort.h
@@ -17,8 +17,8 @@ int partition(vector <int> &v, int start, int end) {
17
if (v[i] > v[pivot] && v[j] < v[pivot]) {
18
swap(v[i], v[j]);
19
}
20
- else if (v[i] <= v[pivot]) { i++; } // while value at the left side is less than pivot move right
21
- else if (v[j] >= v[pivot]) { j--; } // while value at the right side is greater than pivot move left
+ else if (v[i] <= v[pivot]) { i++; }
+ else if (v[j] >= v[pivot]) { j--; }
22
23
24
// we swap the pivot into right position
0 commit comments