def get_min_pos(li): min_pos = 0 for i in range(1, len(li)): if li[i] < li[min_pos]: min_pos = i return min_pos def select_sort(li): for i in range(len(li)-1): # n或者n-1趟 # 第i趟无序区范围 i~最后 min_pos = i # min_pos更新为无序区最小值位置 for j in range(i+1, len(li)): i…
一.测试类SortTest import java.util.Arrays; public class SortTest { private static final int L = 20; public static void main(String[] args) { int [] arr = new int[6]; for (int i = 0; i < arr.length; i++) { arr[i] = (int)((Math.random()+1)*L); } System.out…