package com.axatp.algorithm;
public class AlgorithmSort {
public static void main(String[] args) {
// TODO Auto-generated method stub
BubbleScort bs =new BubbleScort();
bs.MaxScort();
}
}
//冒泡排序:
class BubbleScort{
public void MaxScort(){
int[] arr ={2,3,5,6,1,4};
for(int i=0 ;i<arr.length-1;i++){
for(int j=i;j<arr.length-1;j++){
if(arr[i]>arr[j]){
int num=arr[j];
arr[j]=arr[i];
arr[i]=num;
}
}
System.out.println(arr[i]);
}
}
}