题解 | #冒泡排序#
冒泡排序
https://www.nowcoder.com/practice/83ef53227d654df28c18fd6a377e8fee
//write your code here...... for(int i=0; i<arr.length-1; i++){ for(int j=0;j<arr.length-1-i;j++){ if(arr[j]>arr[j+1]){ arr[j]=arr[j]+arr[j+1]-(arr[j+1]=arr[j]); } } }
冒泡排序