1.冒泡排序

    public static int[] bubble(int[] a){
        for(int i=0;i<a.length-1;i++){
            int tmp=0;
            for(int j=0;j<a.length-i-1;j++){
                if(a[j]<a[j+1]){
                    tmp=a[j];
                    a[j]=a[j+1];
                    a[j+1]=tmp;
                }
            }
            
        }
        return a;
    }

2.快排

 

3.归并排序

 

相关文章:

  • 2021-12-21
  • 2021-04-05
  • 2021-06-15
  • 2021-12-22
  • 2021-05-12
  • 2021-11-23
  • 2021-05-15
猜你喜欢
  • 2021-08-13
  • 2021-12-15
  • 2021-07-31
  • 2021-07-26
  • 2021-09-28
  • 2021-10-27
  • 2021-11-27
相关资源
相似解决方案