<P> Binary search works on sorted arrays . Binary search begins by comparing the middle element of the array with the target value . If the target value matches the middle element , its position in the array is returned . If the target value is less than the middle element , the search continues in the lower half of the array . If the target value is greater than the middle element , the search continues in the upper half of the array . By doing this , the algorithm eliminates the half in which the target value can not lie in each iteration . </P>
<P> Binary search works on sorted arrays . Binary search begins by comparing the middle element of the array with the target value . If the target value matches the middle element , its position in the array is returned . If the target value is less than the middle element , the search continues in the lower half of the array . If the target value is greater than the middle element , the search continues in the upper half of the array . By doing this , the algorithm eliminates the half in which the target value can not lie in each iteration . </P>
binary search is most suitable for what kind of data list
binary search is most suitable for what kind of data list
sorted arrays
sorted arrays