Recursion can also occur indirectly by the invocation of a
function that invokes the function that invoked it. (E.g., A calls B
which calls A ...)
Each instance of a function has "its own set" of local variables
and parameters.
Recursion is an alternative to iteration.
Recursion can often provide a more elegant and a simpler
solution compared to iteration.
Recursive solutions are often less efficient than an iterative
solution.
Some problems are difficult to solve without recursion.
(E.g., When the problem involves processing a recursively defined data
structure).
Recursion requires the following:
BASE CASE: There exists one or more simple solutions to the
problem.
GENERAL RULE: Other cases of the problem can be expressed in
terms of one or more reduced cases of the problem (i.e., closer to the
known simple solutions).
Eventually the problem can be reduced to one of the simple
solutions.
[an error occurred while processing this directive]