1
3
5
7
9
11
13
[0][1][2][3][4][5][6]
Concept
▸1lo = 0, hi = n − 1 // candidates: arr[lo..hi]2while lo ≤ hi:3 mid = (lo + hi) / 24 if arr[mid] == target: found!5 if arr[mid] < target: lo = mid + 16 else: hi = mid − 17// each question halves the space → O(log n)
state
- target9
- n7