📅  最后修改于: 2022-03-11 14:58:48.505000             🧑  作者: Mango
bool search(int x[], int n, int k) {
int p = 0;
for (int a = n; a >= 1; a /= 2) {
while (p+a < n && x[p+a] <= k) p += a;
}
return x[p] == k;
}