public class Select {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a[]={1,5,3,2,4,2343,65,12,23,12};
Sort(a);
for(int l :a){
System.out.println(l);
}
}
public static void Sort(int[] a){
int temp;
for(int i=0;i<a.length;i++)
{
int index=getMinIndex(a,i);
if (index!=i)
{
temp=a[i];
a[i]=a[index];
a[index]=temp;
}
}
}
public static int getMinIndex(int a[],int i){
int min=a[i];
int index=i;
for (int f=index;f<a.length;f++)
{
if(a[f]<min)
{
min=a[f];
index=f;
}
}
return index;
}
}