Created
September 17, 2022 18:23
-
-
Save fnbk/688c845438368ccbc88ebe2538d9929d to your computer and use it in GitHub Desktop.
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
public static int[] BubbleSort(List<int> listInput) | |
{ | |
for (int i = 0; i < listInput.Count; i++) | |
{ | |
for (int j = 0; j < listInput.Count; j++) | |
{ | |
if (listInput[i] < listInput[j]) | |
{ | |
var temp = listInput[i]; | |
listInput[i] = listInput[j]; | |
listInput[j] = temp; | |
} | |
} | |
} | |
return listInput.ToArray(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment