To future students who are using this exam as a study guide, I give you the following advice. If you're done 30 minutes early, go over your exam again and make sure that you are answering the question that I asked. For example, those of you who used vectors for Question 1 probably should have reread the question, especially the comment about O(n) space. Those of you who only addressed case 3 in question 4 should have remembered that there were three cases upon proofreading.
Yes, question 3 was hard, but I assume that you reread the lecture notes as part of studying, and that if you didn't understand the recursion in class, you made sure that you did as part of studying.