Cognizant Interview Question

Binary search code