算法—基数排序
def radix_sort(li):max_num = max(li)it = 0 #表示桶的编号while 10**it <= max_num:buckets = [[] for _ in range(10)] #分10个空桶for val in li:digit = (val // 10**it) % 10 #对列表中的数字进行分桶 987%10=7buckets[digit].append(val)li.clear()for buc in buckets:li.extend(buc)it += 1 import random
li = [random.randint(1,10) for i in range(100)]
radix_sort(li)
print(li)