Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
public class SelectionSort {
 public int[] sort(int[] numbers) {
int size = numbers.length;
for (int i = 0; i < size; i++) {
int min = numbers[i];
for (int j = i; j < size; j++) {
if (min > numbers[j]) {
int tmp = min;
min = numbers[j];
numbers[j] = tmp;
}
numbers[i] = min;
}
}
return numbers;
 }
}
Owner

nyoronzoi commented Feb 19, 2017

選択ソート

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment