mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 06:56:06 +00:00
Several bug fixes (#984)
* Fix quick_sort.md * Disable instant loading for mathjax rendering * Fix the summary.md of chapter_sorting * Two bug fixes
This commit is contained in:
@@ -38,4 +38,4 @@ $$
|
||||
|
||||
- **时间复杂度 $O(nk)$**:设数据量为 $n$、数据为 $d$ 进制、最大位数为 $k$ ,则对某一位执行计数排序使用 $O(n + d)$ 时间,排序所有 $k$ 位使用 $O((n + d)k)$ 时间。通常情况下,$d$ 和 $k$ 都相对较小,时间复杂度趋向 $O(n)$ 。
|
||||
- **空间复杂度 $O(n + d)$、非原地排序**:与计数排序相同,基数排序需要借助长度为 $n$ 和 $d$ 的数组 `res` 和 `counter` 。
|
||||
- **稳定排序**:与计数排序相同。
|
||||
- **稳定排序**:当计数排序稳定时,基数排序也稳定;当计数排序不稳定时,基数排序无法保证得到正确的排序结果。
|
||||
|
||||
Reference in New Issue
Block a user