(有序的顺序表)
int Binary_Search(int L[],int key)
{
int low = 0;
int high = L.Length - 1;
int mid;
while(low <= high)
{
mid = (low + high) / 2;
if(L[mid] == key)
return mid;
else if(L[mid]>key)
high = mid - 1;
else low = mid + 1;
}
return -1;
}