全部博文(161)
分类: Java
2015-03-12 13:05:07
public void bubbleSort(int[] array) {
if(array == null)
return;
int length = array.length;
for(int i=0; i<length-1; i++){
for(int j=0; j<length-i-1; i++){
if(array[j] < array[j+1]){
int temp = array[j];
array[j+1] = array[j];
array[j] = temp;
}
}
}
}