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.
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.