Wrong algorithm

its should be start=mid, if the value =key

as the current index can also be the upper/lowerbound