package com.sksort;
public class select_simpleselect {
public static void main(String[] args) {
int a[] = { 10, 9, 8, 7, 6, 5, 4, 3,2, 1 };
select_simpleselect s = new select_simpleselect();
s.sort(a);
s.show(a);
}
public void sort(int a[]) {
int min = 0;
int temp;
for(int i=0;i<a.length;++i){
min = i;
for(int j=i+1;j<a.length;++j){
if(a[j]<a[min])
min = j;
}
temp = a[i];
a[i] = a[min];
a[min] = temp;
}
}
public void show(int a[]) {
for (int i = 0; i < a.length; i++) {
if (i == 0)
System.out.print(a[i]);
else
System.out.print(" " + a[i]);
}
System.out.println();
}
}