Pergunta de entrevista da empresa Cognizant

Explain binary search and write it's code