Qualcomm Interview Question

Write a program for binary search?