Skip to content

Instantly share code, notes, and snippets.

@djg
Created May 20, 2010 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djg/407279 to your computer and use it in GitHub Desktop.
Save djg/407279 to your computer and use it in GitHub Desktop.
void sort(int* A, int n)
{
for (int i = 0; i < n; ++i)
for (int j = i+1; j < n; ++j)
if (A[j] < A[i])
{
int tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment