package com.wdl.day07;

import java.util.Arrays;

/**
* @创建人 wdl
* @创建时间 2021/8/9
* @描述
*/
public class BubbleSortTest {
public static void main(String[] args) {
int[] arr = {4, 0, 2, 5, 4, 8, 7, 8, -2, -9, 66};
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]){
int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
System.out.println(Arrays.toString(arr));
}
}