Skip to content

Instantly share code, notes, and snippets.

@afishr
Created September 17, 2018 05:56
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 afishr/446bbc4b52bd60ed34afa1248f36426e to your computer and use it in GitHub Desktop.
Save afishr/446bbc4b52bd60ed34afa1248f36426e to your computer and use it in GitHub Desktop.
// Bubble sort
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N - i; j++)
{
if (array[j] > array[j + 1])
{
swap(array[j+1], array[j]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment