//
private void selectSort(int[] datas){
int length = datas.length;
for(int i=0;ib){// ,
min = j;
}
}
int temp = datas[min];
datas[min] = datas[i];
datas[i] = temp;
Log.i("sort", Arrays.toString(datas)+" i:"+i);
}
}
//
private void bubbleSort(int[] datas) {
int length = datas.length;
boolean flag;
for (int i = 0; i < length - 1; i++) {
flag = false;// flag
for (int j = 0; j < length - i-1; j++) {
if (datas[j] > datas[j+1]) {// ,
int temp = datas[j];
datas[j] = datas[j+1];
datas[j+1] = temp;
flag = true;
}
Log.i("sort", Arrays.toString(datas) + " j:" + j + " length-i:" + (length - i));
}
if(!flag){// flag false, , for
break;
}
}
}