Skip to content

Instantly share code, notes, and snippets.

@afishr afishr/bubble_sort.c
Created Sep 17, 2018

Embed
What would you like to do?
// 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
You can’t perform that action at this time.