51,412
社区成员
发帖
与我相关
我的任务
分享public class SelectionSort {
public static void selectionSort (double[] list) {
for(int i=0; i<list.length-1; i++) {
double currentMin = list[i];
int curentMinIndex = i;
for(int j=i+1; j<list.length; j++) {
if()currentMin > list[j] {
currentMin = list[j];
currentMinIndex = j;
}
}
if(currentMinIndex != i) {
list[currentMinIndex] = list[i];
list[i] = currentMin;
}
}
}
}