else if entry pointed to by mid is less than search key, move bottom up to eliminate lower half from consideration

else if (data[mid].key < key)

bottom = mid - 1;