public void selectSort()
{
int i,j,min;
for (i=0;i
{
min=i; //The first element is the first minimum
for (j = i+1;j
if(data[j] < data[min])//if new item smaller
min = j;//It is the new minimum
swap(i,min);
}
}
or you can see example from this video from youtube
watch me
1 comments:
basic sort
Post a Comment