package pakage1;
public class quickSo {
public static void main(String[] args) {
int[] a = {34,3,53,2,23,7,14,10};
//冒泡排序
bubblingSort(a);
//选择
changeSort(a);
//插入排序
insertSort(a);
//快速排序
quiteSort(a);
}
//快速
public static void quiteSort(int[] a) {
if(a.length>0){
quite(a,0,a.length-1);
}
for(int i=0;i<a.length;i++){
System.out.print(a[i]+" ");
}
System.out.println("");
}
public static void quite(int[] a, int low, int hight) {
if(low<hight){
int middle = getMiddle(a,low,hight);
quite(a, low, middle-1);
quite(a, middle+1, hight);
}
}
public static int getMiddle(int[] a, int low, int hight) {
int tmp = a[low];
while(low < hight){
while(low < hight && a[hight]>tmp){
hight --;
}
a[low] = a[hight];
while(low < hight && a[low]<=tmp){
low ++;
}
a[hight] = a[low];package pakage1;
public class quickSo {
publi