Closed pezy closed 9 years ago
Have a look at: https://github.com/haoel/leetcode/blob/master/src/searchInsertPosition/searchInsertPosition.cpp#L28
int mid = low +(high-low)/2;
would occur overflow. try to change to this:
int mid = (high-low)/2;
Sorry, My mistake.
Have a look at: https://github.com/haoel/leetcode/blob/master/src/searchInsertPosition/searchInsertPosition.cpp#L28
would occur overflow. try to change to this: