Chapter 13. Recursion

Table of Contents

1. Recursion

IN THIS CHAPTER, we look at an advanced programming technique, recursion, and some applications. The basic idea behind recursion is related to the seemingly paradoxical idea of defining something in terms of itself. This turns out to be a remarkably powerful idea.

A method is said to be recursive if it calls itself, either directly or indirectly. That is, the method is used in its own definition. Recursion can often be used to solve complex problems by reducing them to simpler problems of the same type.