I found this quite interesting. Basically, given the following description: Binary search solves the problem [of searching within a pre-sorted array] by keeping track of a range within the array in ...
Because it has the wrong semantics. -0 is 0, and we want to return -1 in that case. You could replace it with "-(low + 1)" (though i haven't proved that to myself just yet). The point of the return ...