标签:pre bsp exchange for sele minimal div span select
1 selection
def selectionSort(list, order=True): for i in range(len(list) - 1): # mark minimal index min_index = i # select minimal element for j in range(i + 1, len(list)): if order: if list[j] < list[min_index]: min_index = j else: if list[j] > list[min_index]: min_index = j # exchange index if min_index != i: list[i], list[min_index] = list[min_index], list[i]
标签:pre bsp exchange for sele minimal div span select
原文地址:https://www.cnblogs.com/xywong/p/10729362.html