12 2022 档案
摘要:def selection_sort(alist): n = len(alist) # 需要进行n-1次选择操作 a = 0 for i in range(n-1): # 记录最小位置 min_index = i exit = i # 从i+1位置到末尾选择出最小数据 for j in range(
阅读全文
摘要:# Start with a list of numbers that ain't sorted numbers=[0,5,1,4,2,8] # Keep track of whether any swaps were made on the previous i teration # If no
阅读全文