`
meikebo
  • 浏览: 16046 次
社区版块
存档分类
最新评论
文章列表
private int partion(int[] a, int low ,int height) { int provkey=a[low]; while(low<height) { while(low<height && provkey<=a[height]) height--; a[low]=a[height]; while(low<height && provkey>a[low]) low++; a[height]=a[low]; } a[ ...
public void BubbleSort(T[] a) { T temp; boolean flag; for(int i=a.length-1;i>0;i--) { flag=true; for(int j=0;j<i;j++) { if(a[j].compareTo(a[j+1])>0) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; flag=false; } } if(flag) ...
Global site tag (gtag.js) - Google Analytics