sorting

Can someone tell me which type of sorting is this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
void SortData(int list[], int no)
{  int i, index, j, largest;
   for(i=no; i>=0; i--)
   {  largest=list[0];
      index=0;
      for(j=1; j<=i; j++)
      if(list[j]>largest)
      {  largest=list[j];
         index=j;
      }  
   }
   list[index]=list[i];
   list[i]=largest;
}
YOur code has several errors and will not sort anything, but intention was to create a selection sort.
ok, thx, but y it is not for insertion sort?
Topic archived. No new replies allowed.