2015年3月18日星期三

slogs for week 9: Term test 2

For this week, the only task is taking Term Test 2. I spent three full days preparing for this test from Sunday to Tuesday because I must improve my recursion coding skills. 

I prepared for this test mainly by doing previous labs. There are still many questions I have not solved. Initially, just as I mentioned in the last slog, I could not handle the recursion problem fluently and I must thoroughly trace the function otherwise I cannot come up with a solution. However, when I asked a second-year student for a solution, he could always quickly solve the questions, which really shocked me. I asked him how I can figure out the solution as quickly as possible. He said "You don't need to trace the recursion. You just need to think about one tree or plus a sub-tree. To put it another way, you can solve most recursion problems within one or two steps." After three-day practice, I finally comprehend his words. Furthermore, in csc240 course, I have learned the proof of recursive algorithm at the same time. Under the guidance of this course, I found that recursion in mathematical expression is induction. Therefore, I grasped the key to recursion. Every time when I solve a recursion, I only need to think about the equivalent induction. Induction is the reason why we only need to take one or two recursive steps into consideration. It just simply repeats same calls every time. So we are only required to find different complete cases for each time.

Luckily, I got a good test on Wednesday. As most coding problems in the exam are variant versions of lab questions, I solved all of them rapidly.  

      

没有评论:

发表评论