菜鸟第一次发博客,求各位大佬指点
直接进入主题,看代码:
冒泡排序
for (int i = 0; i < array.length-1; i++) {
for (int j = 0; j < array.length-i-1; j++) {
if(array[j] > array[j+1]){
array[j]=array[j]^array[j+1];
array[j+1]=array[j]^array[j+1];
array[j]=array[j]^array[j+1];
}
}
}
选择排序
for (int i = 0; i < array.length-1; i++) {
int min = array[i]