Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit caaff38

Browse filesBrowse files
Update quickSort.h
1 parent 13e099e commit caaff38
Copy full SHA for caaff38

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎quickSort.h

Copy file name to clipboardExpand all lines: quickSort.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ int partition(vector <int> &v, int start, int end) {
1717
if (v[i] > v[pivot] && v[j] < v[pivot]) {
1818
swap(v[i], v[j]);
1919
}
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
20+
else if (v[i] <= v[pivot]) { i++; }
21+
else if (v[j] >= v[pivot]) { j--; }
2222
}
2323

2424
// we swap the pivot into right position

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.