test for more records to be searched and search key not yet found

while ((top <= bottom) && !(*pfound))