Xoriant interview question

Explain and write a program for binary search.