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

Sign up
Appearance settings

Commit f62636b

Browse files
authored
Update 5.mergeSort.md
1 parent 0c614a8 commit f62636b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎5.mergeSort.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ void merge(vector<int>& nums, int l, int mid, int r) {
247247
}
248248
copy(tempary.begin(), tempary.begin() + index, nums.begin() + l);
249249
}
250-
void mergeSort(vector<int>& nums, int l, int r) {// range is [l, r), so if there is a 0-index array arr whose length is n, "mergeSort(arr, 0, n)" should be called
251-
if (r - l <= 1) {
250+
void mergeSort(vector<int>& nums, int l, int r) {// sort the range [l, r), so if there is a 0-index array arr whose length is n
251+
if (r - l <= 1) { //and you want sort the whole array, "mergeSort(arr, 0, n)" should be called
252252
return;
253253
}
254254
int mid = (l + r) / 2;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /