Last updated 2 years ago
mid = low + (high - low) >> 1 will not work. >>'s precedence is lower, so it needs to be in parentheses.
mid = low + (high - low) >> 1