Skip to content

Commit 6c02e93

Browse files
committed
使其成为一个稳定排序
1 parent e0e4e68 commit 6c02e93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/12_sorts/MergeSort.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func merge(arr []int, start, mid, end int) {
2727
j := mid + 1
2828
k := 0
2929
for ; i <= mid && j <= end; k++ {
30-
if arr[i] < arr[j] {
30+
if arr[i] <= arr[j] {
3131
tmpArr[k] = arr[i]
3232
i++
3333
} else {

0 commit comments

Comments
 (0)