Binary Search

One of the most fundamental algorithms that appears in interviews at big tech companies is Binary Search . Of course, nobody will ask you to implement binary search directly. However, as Jon Bentley cited in his famous book Programming Pearls , only a small percentage of people he asked—10% to be precise—were able to code this algorithm without any errors. &#xA; Here, I will show you a correct…