冒泡算法: 实现1: a = [,,,,,,,,,,,,,,] def bubble(badlist): sort = False while not sort: sort = True ): ]: sort = False badlist[i],badlist[i+] = badlist[i+],badlist[i] bubble(a) print(a) 实现2 data = [10,4,33,21,54,3,8,11,5,22,2,1,17,13,6] for j in range(len(…