Binary search algorithm extracted from Jon Bentley's Programming Pearls, for searching sorted arrays.