Skip to content

Commit 63ef875

Browse files
committed
修改归并排序错误
1 parent b55b5e6 commit 63ef875

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

十大排序算法_Java/Merge.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ private int[] combine(int[] left, int[] right) {
3333
} else if (r >= right.length) {
3434
res[i] = left[l++];
3535
} else if (left[l] < right[r]) {
36-
res[i] = left[r++];
36+
res[i] = left[l++];
3737
} else {
38-
res[i] = right[l++];
38+
res[i] = right[r++];
3939
}
4040
}
4141
return res;

0 commit comments

Comments
 (0)