mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-15 00:26:05 +00:00
Fix the deconstructor of linkedlist_queue.cpp
This commit is contained in:
@@ -13,7 +13,7 @@ int digit(int num, int exp) {
|
||||
}
|
||||
|
||||
/* 计数排序(根据 nums 第 k 位排序) */
|
||||
void countSort(int nums[], int size, int exp) {
|
||||
void countingSort(int nums[], int size, int exp) {
|
||||
// 十进制的各位数字范围为 0~9 ,因此需要长度为 10 的桶
|
||||
int *bucket = (int *) malloc((sizeof(int) * 10));
|
||||
// 借助桶来统计 0~9 各数字的出现次数
|
||||
@@ -57,7 +57,7 @@ void radixSort(int nums[], int size) {
|
||||
// k = 2 -> exp = 10
|
||||
// k = 3 -> exp = 100
|
||||
// 即 exp = 10^(k-1)
|
||||
countSort(nums, size, exp);
|
||||
countingSort(nums, size, exp);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user