public void bubbleSort(int[] a) {
for(int i=0; i<a.length-1; i++) {
boolean stop = true;
for(int j=0; j<a.length-1-i;j++) {
if(a[j]>a[j+1]) {
int tmp = a[j+1];
a[j+1] = a[j];
a[j]=tmp;
stop = false;
}
//System.out.println(Arrays.toString(a));
}
if(stop) {
break;
}
}
System.out.println(Arrays.toString(a));
}