JAVA必会算法--冒泡排序

pop(int[] a){

  for(int i = 0;i<a.length;i++){

    for(int j=a.lenght-1;j>0;j++){

      if(a[j]>a[j+1]){

        int tmp = a[j];

        a[j] = a[j+1];

        a[j+1] = tmp; 

      }

    }

  }

}

posted @ 2017-04-21 11:49  GTM_AI编程  阅读(125)  评论(0编辑  收藏  举报