Last active
August 29, 2015 14:24
-
-
Save Pr3d4dor/ffb65f905a92b4c382ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Selection sort function in c | |
void selectionSort(int *vet,int n){ | |
int i,j,min,aux; | |
for (i=0;i<n-2;i++){ | |
min=i; | |
for (j=i+1;j<n;j++){ | |
if (vet[j]<vet[min]) | |
min=j; | |
} | |
aux=vet[i]; | |
vet[i]=vet[min]; | |
vet[min]=aux; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment