-
-
Save 1RodrigoSoares/e69d4f7ab24e4d033523a0acf69b0461 to your computer and use it in GitHub Desktop.
BubbleSort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void bubbleSort(int array[], int size) { | |
for (int i = 0; i < size - 1; i++) { | |
for (int j = 0; j < size - i - 1; j++) { | |
if (array[j] > array[j + 1]) { | |
int temp = array[j]; | |
array[j] = array[j + 1]; | |
array[j + 1] = temp; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment