Sunday, 2 March 2014

Week 7: Recursion

What is recursion exactly? That's a question that I most definitely had going into this course. Through the course of high school computer sciences courses, you graze lightly upon the topic of recursion and the idea and concept of how it all works never really sinks in. In these past few weeks my basic foundation of knowledge and understanding of recursion has improved significantly. Recursion is a technique used for many applications in programming and can greatly shorten the amount of code that is written. Although the code may be shorter, the method of recursion is not necessarily always the most efficient method. Recursion occurs when you attempt to break a large problem into sub-problems and use the results of these sub-problems in order to achieve the result of the large problem. The problem that most people struggle with is finding the base case, which is the simplest sub-problem which we can easily calculate the result for. By working from the base case and solving larger problems until we are able to solve the entire problem, we can figure out a solution solely knowing the algorithm in python and the base case. I had a great amount of trouble learning and adapting to recursion, but through the many examples and questions we obtained in our lectures and labs, I was able to effectively and thoroughly grasp recursion and put it on many applications such as our assignments and test.

No comments:

Post a Comment