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 7ec1334 commit 9627ee6Copy full SHA for 9627ee6
quickSort.h
@@ -19,10 +19,8 @@ int partition(vector <int> &v, int start, int end) {
19
if (v[i] > v[pivot] && v[j] < v[pivot]) {
20
swap(v[i], v[j]);
21
}
22
- // while value at the left side is less than pivot move right
23
- else if (v[i] <= v[pivot]) { i++; }
24
- // while value at the right side is greater than pivot move left
25
- else if (v[j] >= v[pivot]) { j--; }
+ else if (v[i] <= v[pivot]) { i++; } // while value at the left side is less than pivot move right
+ else if (v[j] >= v[pivot]) { j--; } // while value at the right side is greater than pivot move left
26
27
28
// we swap the pivot into right position
0 commit comments