Skip to content

Instantly share code, notes, and snippets.

View filannim's full-sized avatar

Michele Filannino filannim

View GitHub Profile
#!/usr/bin/env python
def radix_sort(l):
modulus, div = 10, 1
while True:
buckets = [[] for i in range(modulus)]
for value in l:
buckets[(value % modulus) / div].append(value)
modulus, div = modulus * 10, div * 10
if len(buckets[0]) == len(l):