Re:Binary search with confidence
by charcircuit on Monday March 07, 2022 @09:42AM
(#30588359)
It's more comparable to:
If ints are 32 bit you would expect to be able to add 1 to 2^20, but that causes an overflow with this implementation. (low + high) / 2 is arguably worse because you turn the algorithm from working on any array into one that only works on arrays that are small enough not to cause the overflow.
[ Parent
| on HN ]
There are no comments on this comment yet.