Wipro interview question

Code for binary search