Conceptual
Login

Binary Search

Binary search finds a key in sorted data by halving the candidate range each comparison, taking O(log n) steps. It only works because the data is sorted — maintaining order is the price paid for logarithmic lookup.