用Python把數組從小到大排序(選擇排序)

用Python把數組從小到大排序(選擇排序)代碼: #coding=utf-8 ‘’’ #選擇排序 Created on 2019年12月8日 @author: LWJ ‘’’ def findSmallest(arr): smallest = arr[0] #存儲最小的值 smallest_index = 0 #存儲最小元素的索引 for i in range(1,len(arr)): if a
相關文章
相關標籤/搜索