Add bucket_sort.cpp and bucket_sort.py (#446)

This commit is contained in:
Yudong Jin
2023-03-30 03:44:26 +08:00
committed by GitHub
parent 475ba8baa7
commit 830ec69d39
3 changed files with 78 additions and 1 deletions

View File

@@ -74,7 +74,7 @@
[class]{}-[func]{bucketSort}
```
!!! question "桶排序的应用场景是什么?"
!!! question "桶排序的应用场景是什么?"
桶排序一般用于排序超大体量的数据。例如输入数据包含 100 万个元素,由于空间有限,系统无法一次性将所有数据加载进内存,那么可以先将数据划分到 1000 个桶里,再依次排序每个桶,最终合并结果即可。