Skip to content

Instantly share code, notes, and snippets.

@imphasing
Created July 16, 2012 02:57
Show Gist options
  • Save imphasing/3120145 to your computer and use it in GitHub Desktop.
Save imphasing/3120145 to your computer and use it in GitHub Desktop.
void sort(int *list, int size)
{
int i = 0;
for (i = 0; i < size; i++) {
int current_elem = list[i];
int z = 0;
for (z = i + 1; z < size; z++) {
if (current_elem > list[z]) {
int swapped = list[z];
list[z] = current_elem;
list[i] = swapped;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment