We introduced recursion in Chapter 6 and showed how to write recursive methods
to implement mathematical functions. We used mathematical functions in
Chapter 6 because it is easier to see how the recursion works with mathematical
functions. However, recursive methods are not limited to implementing mathematical
functions, and we will present several nonnumerical recursive algorithms in
this chapter. We will also discuss some criteria for deciding when to use recursion
and when not to. All the recursive algorithms we provide in this chapter, other than
those we use for explanation, are algorithms that should be written recursively.
To learn more about the book this website supports, please visit its Information Center.