This week we have an assigned topic which is to revisit an earlier slog to see what have been changed in our mind. I will revisit my third slog, which is the impression of tracing recursion. At that time, I said that recursion is my favorite part in this course so far because it is easy and interesting, but now, I changed my mind after using recursion in a tree and linked list, etc. Recursion is one of the most difficult parts to learn in this course. I have to say, using recursion in our code really helps a lot and looks simple and clear. It is much better than writing whole bunch of codes that is awkward for people to see. However, every time I'm asked to write a code with recursion, I feel like confused and have to spend a lot of time working on it. However, the good thing is that in assignment 3, I can figure out how to write a grow function using recursion by myself. It suddenly brings me confidence and encourages me to study more on recursion. Hopefully, by the time the final exam comes, I'm not afraid of recursion any more.
compared with this slog http://148slogger.blogspot.ca/, I find that we have the same problem and it is not only me that have a problem on recursion. The key part of recursion is to figure out the base case and the body. So, just like the instructor says, every time you write a recursive code,work from the base case up, and then test your base case. Once you are sure it works, test a problem one step larger. Practice more on recursion with this method and I'm sure it can be solved easily.
No comments:
Post a Comment