
Binary Search
Binary search is an efficient method for finding an item in a sorted list. Instead of checking each element one by one, it compares the target value to the middle element of the list. If the target is equal to the middle element, it’s found. If it's less, the search continues in the lower half; if greater, in the upper half. This process repeats, halving the search area each time, until the item is found or the search area is empty. This significantly reduces the number of comparisons needed compared to a simple linear search.