本文共 369 字,大约阅读时间需要 1 分钟。
public class Test { public void test() { int test[] = {49,38,65,97,76,13,27,49,78,34,12,64,5,4,62,99,98,54,101,56,17,18,23,34,15,35,25,53,51}; //int test[] = {5,4,3,2,1}; Bubble bubble = new Bubble(); bubble.sort(test); for( int i=0;ia[j] ) { int tmp = a[i]; a[i] = a[j]; a[j] = tmp; cnt++; } } }while(cnt!=0); } }}
转载地址:http://tvhii.baihongyu.com/