选择排序原理及Java实现(2)
发布时间:2021-06-06
发布时间:2021-06-06
if (data[j] < value) {
minPos = j;
value = data[j];
}
}
if (minPos != -1) {
tmp = data[i];
data[i] = value;
data[minPos] = tmp;
}
// for (int k = 0; k < len; k++) {
// System.out.print(data[k] + " , "
// }
// System.out.println();
}
}
public static void main(String[] args) {
int[] coll = {
37, 40, 38, 42, 461, 5, 7, 9, 12
};
selectionSort(coll);
for (int i = 0; i < coll.length; i++) {
System.out.print(coll[i] + " , "); );
上一篇:不定积分的典型例题