Рет қаралды 12,360
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. It searches a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array.