摘要: public void bubblesort(int[] r) { int i,j,temp; //交换标志 bool exchange; //最多做r.length-1趟排序 for(i=0; i=i; j--) { //交换条件 if(r[j+1]<r[j]) { temp=r[j+1]; r[j+1]=r[j]; r[j]=temp; //发生了交换,故将交换标志置为真 exchange=... 阅读全文
posted @ 2007-11-12 13:45 Derek 阅读(296) 评论(0) 推荐(0) 编辑