MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / bucketsort

Method bucketsort

Sort-all/bucket.py:11–17  ·  view source on GitHub ↗
(A)

Source from the content-addressed store, hash-verified

9 return A
10
11 def bucketsort(A):
12 buckets, m, S = [[] for _ in range(1000)], min(A), []
13 R = max(A) - m
14 if R == 0: return A
15 for a in A: buckets[999*(a-m)//R]
16 for b in buckets: S.extend(insertion_sort(b))
17 return S
18
19 return bucketsort(N)
20

Callers

nothing calls this directly

Calls 1

insertion_sortFunction · 0.85

Tested by

no test coverage detected