This commit is contained in:
krahets
2023-05-16 14:51:37 +08:00
parent 7f43facfd9
commit 749918677f
5 changed files with 649 additions and 52 deletions

View File

@@ -103,7 +103,7 @@ comments: true
func countingSortNaive(nums []int) {
// 1. 统计数组最大元素 m
m := 0
for num := range nums {
for _, num := range nums {
if num > m {
m = num
}
@@ -424,7 +424,7 @@ $$
func countingSort(nums []int) {
// 1. 统计数组最大元素 m
m := 0
for num := range nums {
for _, num := range nums {
if num > m {
m = num
}