Lesson
Binary Search in PHP Lesson: Classic, Boundary and Answer-Space Patterns
Binary search cuts the search space in half on every step, so it finds an answer in O(log n) time. It isn't only for finding a value in a sorted array. Here are the three forms that show up in…