循環的冒泡法:
public static void sort(int[] array){
long time= System.currentTimeMillis();
for(int i=0;i<array.length;i++){
for(int j=0;j<array.length-1-i;j++){
if(array[j]>array[j+1]){
int temp=array[j];
array[j]=array[j+1];
array[j+1]=temp;
}
}
}
long time1=System.currentTimeMillis();
System.out.println(time1-time);
}