Tuesday, 3 March 2015

Week 7

Recursion is another interesting yet very important concept taught to us in this class. It is a powerful concept that involves a function/method calling itself. It is a tough concept for many people to wrap their heads around, but learning it is very worthwhile, as there are many applications for recursion, even outside of computer science.

Understanding recursion takes a lot of practice. The way we were taught to think about it was to first think about the base case of the function you are designing, what the function returns at the end of the recursive chain, so to speak. After you have designed the base cases, you think about small scale cases of how the function works before the base case. This is the hard part, and requires a ton of thinking. After you get through this step, combine the 2 above steps and you should have a working recursive function.

I feel that I have a good grasp of recursion at this point in the course, mainly due to working on the labs for this course. Tracing recursion was simple enough, but making recursive functions took a lot of practice and thinking, especially for the course's second assignment. Hopefully this practice will pay off in my future as a computer scientist.

No comments:

Post a Comment