Circular binary search.