/**
* TODO 冒泡排序
*
* @author Roy
* @date 2021/3/13 10:08
*/
public class BubbleSort {
public static void main(String[] args) {
int []bb = new int[]{1,23,4325,456,346,2,1,2,3,56,7};
int[] aa = bubbleSort(bb);
for(int c:aa) System.out.println(c);
}
public static int[] bubbleSort(int sortArray[]){
for(int i=0;i<sortArray.length;i++){
for(int j=0;j<sortArray.length-i-1;j++){
if(sortArray[j]<sortArray[j+1]){
int temp = sortArray[j];
sortArray[j] = sortArray[j+1];
sortArray[j+1] = temp;
}
}
}
return sortArray;
}
}