Skip to content

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)