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 9627ee6

Browse filesBrowse files
Update quickSort.h
1 parent 7ec1334 commit 9627ee6
Copy full SHA for 9627ee6

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-4
lines changed

‎quickSort.h

Copy file name to clipboardExpand all lines: quickSort.h
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ int partition(vector <int> &v, int start, int end) {
1919
if (v[i] > v[pivot] && v[j] < v[pivot]) {
2020
swap(v[i], v[j]);
2121
}
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--; }
22+
else if (v[i] <= v[pivot]) { i++; } // while value at the left side is less than pivot move right
23+
else if (v[j] >= v[pivot]) { j--; } // while value at the right side is greater than pivot move left
2624
}
2725

2826
// 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.