Skip to content

The Mindful Programmer

Articles on computing, mathematics, art, and anything in between

Category Archives: Algorithms

Get binary search right the first time

Binary search is one of the first algorithms that people learn. The idea is wonderfully simple: Yet it’s so easy to get the details wrong. In fact, nearly all binary searches are broken. If you set out to write a binary search, you would probably start out with an outline like this:

Posted byJoni2016/11/292019/11/17Posted inAlgorithms, Programming
The Mindful Programmer, Proudly powered by WordPress.