代码填空【使用递归实现二分查找】 int binarySearch(int a[], int key, int low, int high) { if (low > high) return -1; int mid; mid = (low + high) / 2; if (key == a[mid]) return mid; else if (key < a[mid]) return ________(1)__________; else return ________(2)______________; }
A.
(1) binarySearch(a, key, low, mid+1) (2) binarySearch(a, key, mid - 1, high)
B.
(1) binarySearch(a, key, low, mid+1) (2) binarySearch(a, key, mid + 1, high)
C.
(1) binarySearch(a, key, low, mid - 1) (2) binarySearch(a, key, mid + 1, high)
D.
(1) binarySearch(a, key, low, mid - 1) (2) binarySearch(a, key, mid - 1, high)