Wednesday, October 16, 2013

Recursion

Recursion is one of my favorite topics, although I'm not the best at it. Recursion can be defined as calling the function itself in order to solve the problem. Problem is divided to smaller problems, solved and the result is combined. Recursion has two parts: base case(s) that can't be solved with a recursive kind of approach and prevent(s) infinite loop, and recursive part. It is generally slower than iteration, but certainly helps to understand the problem.

No comments:

Post a Comment