This commit is contained in:
krahets
2023-04-09 05:12:22 +08:00
parent 01d05cc1f0
commit 37f11aff68
27 changed files with 265 additions and 248 deletions
+1
View File
@@ -87,6 +87,7 @@ comments: true
```python title="bucket_sort.py"
def bucket_sort(nums: list[float]) -> None:
"""桶排序"""
# 初始化 k = n/2 个桶,预期向每个桶分配 2 个元素
k = len(nums) // 2
buckets = [[] for _ in range(k)]