public static void selectSort(int[] arr) {
if (arr == null) {
System.out.println("null");
return;
}
if (arr.length == 0) {
System.out.println("[]");
}
if (arr != null) {
for (int i = 0; i < arr.length - 1; i++) {
for (int j = i + 1; j < arr.length; j++) {
if (arr[i] > arr[j]) {
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
}
} |
|