Maveric Systems interview question

Write logic for Binary Search