Xoriant Interview Question

Explain and write a program for binary search.