摘要:
# coding:utf-8 def shell_sort(alist): """希尓排序""" # n = 9 n = len(alist) # gap = 4 gap = n // 2 # i = gap # for i in range(gap, n): # i = [gap, gap+1, 阅读全文
摘要:
# coding:utf-8 def insert_sort(alist): """插入排序""" n = len(alist) for j in range(1, n): # j = [1, 2, 3, n-1] # i 代表內層循環起始值 i = j # 執行從右邊的無序序列中取出第一個元素,即 阅读全文