一.java常见算法
快速排序
public void sort(int arr[],int low,int high){
int l=low;
int h=high;
int povit=arr[low];
while(l<h){
while(l<h&&arr[h]>povit){
h--;
}
if(l<h){
int temp=arr[l];
arr[l]=arr[h];
arr[h]=temp;
l++;
}
while(l<h&&arr[l]<povit){
l++;
}
if(l<h){
int tem=arr[l];
arr[l]=arr[h];
arr[h]=tem;
h--;
}
}
if(l>low)
sort(arr, low, l-1);
if(h<high)
sort(arr, l+1, high);
}
哈希算法