java实现冒泡排序
package bubble_sort;
public class bubble_sort {
int[] a;
public bubble_sort(int[] a){
this.a = a;
}
public void bubble_sort_method(){
int i,j,temp=0;
for(i=0;i<a.length-1;i++){
for(j=0;j<a.length-i-1;j++){
if(a[j]>a[j+1]){
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
}
}