Skip to content

Instantly share code, notes, and snippets.

@EugenyB
Created February 8, 2017 20:49
Show Gist options
  • Save EugenyB/f50504176bd933c44c06fb43a640f149 to your computer and use it in GitHub Desktop.
Save EugenyB/f50504176bd933c44c06fb43a640f149 to your computer and use it in GitHub Desktop.
void chooseSort(int a[], int size){
for(int i=0; i < size-1; i++){
int nmin = i;
for(int j=i+1; j<size; j++){
if(a[j]<a[nmin])nmin = j;
}
if(i != nmin){
int t = a[nmin];
a[nmin] = a[i];
a[i] = t;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment