Discrete Mathematics
Binary search is an efficient algorithm used to find a target value within a sorted array by repeatedly dividing the search interval in half. If the target value is less than the middle element, the search continues in the lower half, while if it’s greater, it proceeds in the upper half. This method significantly reduces the number of comparisons needed compared to a linear search, making it a fundamental algorithm in computer science.
congrats on reading the definition of Binary Search. now let's actually learn it.