Avoid Overflow when calculating Mid in Binary Search
We denote start of array in binary search by start, left, low, lo. Similarly, we denote end of array in binary search by end, right, high, hi. Now, with that notation lets look look at when the overflow may occur. Problem To find mid, we sometimes use: mid = (start+end)) / 2; OR mid = (start + end) >> 1 ...