algorithm for binary search using divide and conquer method