The feature of this series of blogs is--give the results of each order
Originally wanted to write a good process, get a picture of what, but think online analysis too much, are better, so these blog even if it is a summary of their own it.
#include <stdio.h> void selectsort (int *m, int n) { int i,j,k,temp; BOOL Flag; for (i=0;i<n-1;i++) { k=i; Flag=true; for (j=i+1;j<n;j++) if (M[j]<m[k]) k=j; if (k!=i) { flag=false; TEMP=M[K]; M[k]=m[i]; m[i]=temp; } for (int t=0;t<10;t++) printf ("%d", m[t]); printf ("\ n"); if (flag) return;} } int main () { int i; int a[10]={2,6,5,1,4,3,7,8,9,10}; for (i=0;i<10;i++) printf ("%d", A[i]); printf ("\ n" \ n "); Selectsort (a,10); printf ("\ nthe final result \ n"); for (i=0;i<10;i++) printf ("%d", A[i]); printf ("\ n"); return 0;}
Run results
Sorting algorithm Large Collection _ Select Class--Direct selection of sorting