跳转至内容

算法实现/排序/桶排序

从维基教科书,开放世界下的开放书籍
def bucketSort(a, n, buckets, m):  
    for j in range(m):
        buckets[j] = 0
    for i in range(n):
        buckets[a[i]] += 1
    i = 0
    for j in range(m):
        for k in range(buckets[j]):
            a[i] = j
            i += 1
华夏公益教科书