Sailthru interview question

Please code out the algorithm for binary search