@Test
public void selectionSortTest(){
data = new int[] {3,0,1,8,7,2,5,4,9,6};
for(int i=0; i<data.length; i++) {
int base = data[i];
int min = Integer.MAX_VALUE;
int minI = -1;
for(int j=i; j<data.length; j++) {
if(data[j]<min) {
min = data[j];
minI = j;
}
}
if(min!=base) {
data[i]=min;
data[minI]=base;
}
System.out.printf("%d번째: %s%n", i, Arrays.toString(data));
}
System.out.printf("정렬 완료: %s%n", Arrays.toString(data));
}