Wednesday, 16 October 2013

On Recursion

Foreword: Before I talk about recursion, please keep in mind that recursion is still a concept I'm struggling to grasp. In the coming weeks I'll probably be talking about recursion more in an attempt to understand it better.

Recursion is solving a problem in which the problem has smaller, similar cases of the problem within itself. A common example of this is when a function calls on itself. Generally, a recursive method deals with a "base case", and then calls itself to deal with anything that is a smaller instance that the base case was designed to solve.

Recursion seems to be a very powerful tool when used correctly. It's helpful as it lets you divide a problem into smaller, easier to manage cases, once you are familiar with implementing recursive functions. Hopefully I become familiar with recursion soon.

No comments:

Post a Comment