mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-27 20:32:46 +08:00
build
This commit is contained in:
@ -170,12 +170,13 @@ $$
|
||||
if (num > m)
|
||||
m = num;
|
||||
// 按照从低位到高位的顺序遍历
|
||||
for (int exp = 1; exp <= m; exp *= 10)
|
||||
for (int exp = 1; exp <= m; exp *= 10) {
|
||||
// 对数组元素的第 k 位执行计数排序
|
||||
// k = 1 -> exp = 1
|
||||
// k = 2 -> exp = 10
|
||||
// 即 exp = 10^(k-1)
|
||||
countingSortDigit(nums, exp);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user