News for hackers. Stuff that matters.
Re:Binary search with confidence by nickcw on Monday March 07, 2022 @06:20AM (#30586460)
I agree - the best binary search algorithm is the one someone else wrote, preferably in the standard library of the language you are using.

I've written binary search algorithms maybe a half a dozen times, and every time I get tripped up by some boundary condition or other and what is only a few lines of code takes a really long time to get exactly right for all the corner cases.

Re:Binary search with confidence by mark-r on Monday March 07, 2022 @02:01PM (#30591883)
You'd be surprised how often standard libraries can be broken. The integer overflow bug for binary search has been found in many of them.