Java Reference
In-Depth Information
CHAPTER
20
R
ECURSION
Objectives
To describe what a recursive method is and the benefits of using recur-
sion (§20.1).
■
To develop recursive methods for recursive mathematical functions
(§§20.2-20.3).
■
To explain how recursive method calls are handled in a call stack
(§§20.2-20.3).
■
To solve problems using recursion (§20.4).
■
To use an overloaded helper method to design a recursive method (§20.5).
■
To implement a selection sort using recursion (§20.5.1).
■
To implement a binary search using recursion (§20.5.2).
■
To get the directory size using recursion (§20.6).
■
To solve the Towers of Hanoi problem using recursion (§20.7).
■
To draw fractals using recursion (§20.8).
■
To discover the relationship and difference between recursion and
iteration (§20.9).
■
To know tail-recursive methods and why they are desirable (§20.10).
■