1.10 计数排序 #29
Replies: 5 comments 1 reply
-
更加通俗易懂的理解:https://baijiahao.baidu.com/s?id=1613842852280800384&wfr=spider&for=pc |
Beta Was this translation helpful? Give feedback.
-
这篇文章不错~~ 后期会考虑重新改写一下排序相关的文章,变得更加易懂一些。 |
Beta Was this translation helpful? Give feedback.
-
"逆序遍历数组 arr"的意义是什么?正向遍历数组arr也可以。 |
Beta Was this translation helpful? Give feedback.
-
主要是为了稳定排序。逆序遍历方便确定同值元素在排序之前的前后顺序。 |
Beta Was this translation helpful? Give feedback.
-
大佬,有一处笔误:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1.10 计数排序
计数排序 # 1. 计数排序算法思想 # 计数排序(Counting Sort)基本思想:
使用一个额外的数组 counts,其中第 i 个元素 counts[i] 是待排序数组 arr 中值等于 i 的元素个数。然后根据数组 counts 来将 arr 中的元素排到正确的位置。
2. 计数排
https://algo.itcharge.cn/01_array/01_10_array_counting_sort/
Beta Was this translation helpful? Give feedback.
All reactions