Binary Search Algorithm
What is Binary Search?
Binary search is an efficient algorithm used to find an element in a sorted list by repeatedly dividing the search interval in half.
Steps of Binary Search
- Start with the middle element
- If target equals middle, return it
- If target is smaller, search the left half
- If target is larger, search the right half
Example Diagram
Learn more here:
Binary Search Explanation