mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-09 10:30:59 +00:00
build
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user