fix: fix InsertionSort bug

This commit is contained in:
dudaodong
2022-03-26 18:25:42 +08:00
parent ccc0188352
commit 142deb83b2
2 changed files with 3 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ func InsertionSort[T any](slice []T, comparator lancetconstraints.Comparator) []
preIndex--
}
slice[preIndex+1] = preItem
slice[preIndex+1] = currentItem
}
return slice