...

/

Recursive Problems

Recursive Problems

Learn about the different problems and their recursive solution.

Problem as similar subproblems

In the case of a problem that can be solved by breaking it down into similar subproblems, the computation of a function is described in terms of the function itself.

Suppose we want to calculate the factorial value of nn: n!=n(n1)(n2)(n3)...21\qquad \qquad \qquad \qquad \qquad \qquad n! = n * (n - 1) * (n - 2) * (n - 3) * ... * 2 * 1 ...