if search key found

if (data[mid].key == key)