From dfa5ebdffadd04eb6cda9969912501aa18a6625a Mon Sep 17 00:00:00 2001 From: krahets Date: Wed, 3 May 2023 22:56:53 +0800 Subject: [PATCH] build --- chapter_sorting/counting_sort.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter_sorting/counting_sort.md b/chapter_sorting/counting_sort.md index 7cf992bc2..b9accf8eb 100644 --- a/chapter_sorting/counting_sort.md +++ b/chapter_sorting/counting_sort.md @@ -193,7 +193,7 @@ comments: true } // 2. 统计各数字的出现次数 // counter[num] 代表 num 的出现次数 - int *counter = malloc(sizeof(int) * size); + int *counter = malloc(sizeof(int) * m); for (int i = 0; i < size; i++) { counter[nums[i]]++; } @@ -547,7 +547,7 @@ $$ } // 2. 统计各数字的出现次数 // counter[num] 代表 num 的出现次数 - int *counter = malloc(sizeof(int) * size); + int *counter = malloc(sizeof(int) * m); for (int i = 0; i < size; i++) { counter[nums[i]]++; }