public static int binsrch (int[] a, int key) {
int low = 0;
int high = a.length - 1;
while (true) {
if (low > high) return -(low+1);
int mid = (low + high)/2;
if (a[mid] < key) low = mid + 1;
else if (a[mid] > key) high = mid - 1;
else return mid;
}
有人可以帮忙吗?