3 ms·
People do a terrible job of binary search to the extent that it is towards the back of my toolbox. You can get eaten alive by off-by-one errors, mishandled int
by PaulHoule 4y ago
People do a terrible job of binary search to the extent that it is towards the back of my toolbox. You can get eaten alive by off-by-one errors, mishandled integer overflows, etc. Human-written binary searches work most of the time but often fail for special inputs. I wouldn’t trust a machine that learned by reading 1000s of other people’s binary searches any more than I’d trust one I found off StackOverflow unless it came with a detailed explanation of the corner cases…. It is one to look up in an algorithms book, a recent algorithms book.