Compute and return the square root of
sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3
x. In each iteration, calculate
mid * mid is smaller than
x, search in the higher half (from
high), else search in the lower half (from
Binary Search is easy to understand but can be tricky to implement, pay attention to the conditions and make sure the code exits as expected.