Binary Search - Recursive Implementation
This chapter details the reasoning behind binary search's time complexity
We'll cover the following...
We'll cover the following...
Binary search is a well-known search algorithm that works on an already-sorted input. The basic idea is to successively eliminate half of the remaining search space at each step till either the target is found or there's no more search space left.
Binary search is recursive in nature but can also be implemented iteratively. Below is the recursive implementation of binary search.
Binary Search Implementation
Recurrence Equation
The recurrence equation for binary search is given below:
...