初级工程师之排序算法一一一一一选择排序算法java实现
public static int[] chooseSort(int[] sums) { //双层循环 for (int i = 0; i < sums.length; i++) { //内层循环每次在当前位置选择最大或最小的数 for (int j = i; j < sums.length; j++) { //关键判断决策出剩余数的最大或最小 if (sums[j] < sums[i]) { int temp = sums[j]; sums[j] = sums[i]; sums[i] = temp; } } } return sums; }