????JAVA????????????????????????????????????????????????e????????????????????????
???????????????????????Arrays?е????????Arrays.sort????????
????e??????????????????б??????????????С????????????????????????
???????????????????????????????????С??????????????????????????????顣
?????????????????????????е?????????????????????????????????????????????????????ο???
????<1>????Arrays???е???????????????
1 import java.util.Arrays;
2 public class Test2{
3         public static void main(String[] args){
4                 int[] a={5??4??2??4??9??1};
5                 Arrays.sort(a);  //????????
6                 for(int i: a){
7                         System.out.print(i);
8                 }
9         }
10 }
????<2>e????????
1  public static int[] bubbleSort(int[] args){//e????????
2                 for(int i=0;i<args.length-1;i++){
3                         for(int j=i+1;j<args.length;j++){
4                                 if (args[i]>args[j]){
5                                         int temp=args[i];
6                                         args[i]=args[j];
7                                         args[j]=temp;
8                                 }
9                         }
10                 }
11                 return args;
12         }
????<3>?????????
1 public static int[] selectSort(int[] args){//?????????
2                 for (int i=0;i<args.length-1 ;i++ ){
3                         int min=i;
4                         for (int j=i+1;j<args.length ;j++ ){
5                                 if (args[min]>args[j]){
6                                         min=j;
7                                 }
8                         }
9                         if (min!=i){
10                         int temp=args[i];
11                         args[i]=args[min];
12                         args[min]=temp;
13                         }
14                 }
15                 return args;
16         }