Google Interview Question

Implement an algorithm based on binary search