A good interviewer prefers it if the candidate does not have the algorithm memorized. The whole point is to gauge their problem solving skills. Reciting something from a textbook doesn't tell the interviewer much. The reason you didn't get a favorable reaction in that situation could be because not knowing the algorithm was perfectly acceptable in that situation. It's expected that you figure it out instead of challenging the validity of the question.