-
import random import copy def insertSort(num): """ 插入排序 :param num: :return: """ sortL = [] print(num) for i in range(1, len(num)): key = num[i] j = i - 1 while j >= 0 and key < num[j]: num[j + 1] = num[j] j -= 1 num[j + 1] = key sortL.append(copy.deepcopy(num)) # for i in sortL: # print(i)
-
Python之插入排序
猜你喜欢
转载自blog.csdn.net/weixin_39541632/article/details/102993029
今日推荐
周排行