import java.util.*;/*对给定数组进行排序。{5,1,6,4,2,8,9}*/class ArrayTest2 { /* 选择排序。 内循环结束一次,最值出现头角标位置上。 */ public static void selectSort(int[] arr) { for (int x=0; xarr[y]) { /* int temp = arr[x]; arr[x] = arr[y]; arr[y]= temp; */ swap(arr,x,y); } } } } /* 冒泡排序 */ public static void bubbleSort(int[] arr) { for(int x=0; x