Computer Science, asked by starmogh8533, 1 year ago

Binary search algorithm can be best described as what

Answers

Answered by nibod1248
1

In computer science, binary search, also known as half-interval search,[1] logarithmic search,[2] or binary chop,[3] is a search algorithm that finds the position of a target value within a sorted array.[4][5] 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. Even though the idea is simple, implementing binary search correctly requires attention to some subtleties about its exit conditions and midpoint calculation, particularly if the values in the array are not all of the whole numbers in the range

Answered by anjaliom1122
0

Answer:

Binary search algorithm can be best described as also known as half-interval search.

Explanation:

Binary search, also known as half-interval search, logarithmic search, or binary chop in computer science, is a search algorithm that finds the position of a target value within a sorted array. The binary search compares the target value to the array's middle element. The binary search process begins by comparing an element in the array's middle to the target value. If the target value matches the element, the array's position is returned. If the target value is less than the element, the search proceeds to the array's lower half. If the target value is greater than the element, the search proceeds to the array's upper half. As a result, the algorithm eliminates logarithmic search, or binary chop, finds the position of a target value within a sorted array. The binary search compares the target value to the array's middle element. If they are not equal, the half in which the target cannot lie is eliminated, and the search resumes on the remaining half, comparing the middle element to the target value again and again until the target value is found. If the search results in the remaining half of the array being empty, the target is not in the array.

Similar questions