Binary search is an efficient algorithm for finding an item from a sorted list of items.
It works by repeatedly dividing in half the portion of the list that could contain the item,
until you've narrowed down the possible locations to just one.
Step: 0
Enter a target value and click "Start Search" to begin.
Binary Search Algorithm Steps:
Start with a sorted array and define the search range (left and right pointers)
Find the middle element of the current search range
Compare the middle element with the target value
If they match, the search is complete
If the target is less than the middle element, search the left half
If the target is greater than the middle element, search the right half
Repeat until the target is found or the search range is empty