public static void main(String[] args) {
int[] arr = {13,24,34,54};
}
public static int selectSort(int[] arr) {
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] = int temp;
}
}
}
}
public static void print(int[] arr) {
for (int i = 0; i < arr.length-1; i++) {
System.out.println(arr[i]);
}
}
}
|
|