 Binary search works on sorted arrays.Binary search begins by comparing an element in the middle of the array with the target value.If the target value matches the element, its position in the array is returned.