Last active
November 21, 2017 18:00
-
-
Save Nydhal/fcd5030b17c5275e6bff18cb027766d5 to your computer and use it in GitHub Desktop.
bubble sort in C
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 sortStrings(char strings[NUM_STRINGS][STRING_LENGTH]){ | |
for (int i = 0; i < NUM_STRINGS-1 ; i++){ | |
for (int j = 0; j < NUM_STRINGS-i-1; j++){ | |
if (strcmp(strings[j],strings[j+1])>0) {swapStrings(strings[j], strings[j + 1]); | |
}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment