This is a Logarithmic Time Search Algorithm In this Algorithm we compute the mid by (first + last / 2) Then we check if the mid is the key If the mid is less than key the key is present on the right subarray and viceversa After comparing the mid we make reccursive call to the same function to to check either in right or the left sub array To call for left sub array we update last index to be mid - 1 and to call for right sub array we update first index to be mid + 1 and eventually we fall in the case where the key either matches with mid or the key is not present in the array