复制代码 代码如下:# -*- coding: utf-8 -*- def insertion_sort(A): “””插入排序,作为桶排序的子排序””” n = len(A) if n <= 1: return A B = [] # 结果列表 for a in A: i = len(B) while i > 0 and B[i-1] > a: i = i – 1 B.insert(i, a); return B def bucket_sort(A): “””桶排序,伪