Skip to content

Instantly share code, notes, and snippets.

@theasder
Created July 22, 2015 16:50
Show Gist options
  • Select an option

  • Save theasder/65720527fbcd93b7daba to your computer and use it in GitHub Desktop.

Select an option

Save theasder/65720527fbcd93b7daba to your computer and use it in GitHub Desktop.
void bubble(int* a, int n)
{
int tmp;
for (int i = n - 1; i >= 0; i--)
{
for (int j = 0; j < i; j++)
{
if (a[j] > a[j + 1])
{
tmp = a[j];
a[j] = a[j+1];
a[j+1] = tmp;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment