
C H A P T E R 11
Recursion
11.1 INTRODUCTION
Recursion is a design and programming technique used to implement a repet-
itive task or to implement a circular definition of a data structure. In methods
and functions, recursion involves defining the method or function in terms of
itself, which means that the method or function has a call to itself. Similarly,
a structure is defined in terms of itself.
Recursion can be used to describe a solution in a simpler, clearer manner
than with an iterative solution. Recursion can be used to describe complex
algorithms by pa rtitioning the problem into several smaller subproblems of
the same kind and then combining