Skip to content

Instantly share code, notes, and snippets.

@Pr3d4dor
Last active August 29, 2015 14:24
Show Gist options
  • Save Pr3d4dor/2fd922bc0d473b1b58bf to your computer and use it in GitHub Desktop.
Save Pr3d4dor/2fd922bc0d473b1b58bf to your computer and use it in GitHub Desktop.
//Bubble sort function in c
void bubbleSort(int *vet,int n){
int i,j,aux;
for (i=0;i<n-1;i++){
for (j=0;j<n-i-1;j++){
if (vet[j]>vet[j+1]){
aux=vet[j];
vet[j]=vet[j+1];
vet[j+1]=aux;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment