ABSTRACT

This chapter introduces the reader to the advanced topic of recursion. Recursion is when a method calls itself. Recursive algorithms try to break a complex problem into smaller versions of the same problem, where the smaller versions are solved in the same way (i.e., by breaking them further into smaller problems). Of course, this process should not continue infinitely and at some point the problem should become simple enough so that it can be solved directly (we will refer to this as the base case of the recursive program).