Created
March 21, 2019 10:48
-
-
Save bastienapp/adcae39004b93fdc4b3735384b4cdfef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class SortArray { | |
public static int[] sort(int[] tableInt){ | |
for(int j = 0; j < tableInt.length - 1; j++) { | |
int minValue = tableInt[j]; | |
int index = j; | |
for (int i = j + 1; i < tableInt.length; i++){ | |
if (minValue > tableInt[i]) { | |
minValue = tableInt[i]; | |
index = i; | |
} | |
} | |
tableInt[index] = tableInt[j]; | |
tableInt[j] = minValue; | |
} | |
return tableInt; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment