Qualcomm interview question

Write a program for binary search?