search algorithm in sorted lists that operates by decreasing the search space by half each pass
Binary search is a method for finding a specific item in a sorted list by repeatedly dividing the search area in half, eliminating half of the remaining possibilities with each step. It matters because this approach is much faster than checking every item one by one, especially when dealing with large lists.
AI-generated from the Wikipedia summary — may contain errors.
via Wikipedia infobox
In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array.
Binary search runs in logarithmic time in the worst case, making
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).