Chapter Summary


[Page 594 (continued)]

Technical Terms

base case

computational overhead

head-and-tail algorithm

iterative method

last-in/first-out (LIFO)

method call stack

recursion parameter

recursive case

recursive definition

recursive method

self-similarity

tail recursive

Summary of Important Points

  • A recursive definition is one that defines the nth case of a concept in terms of the (n-1)st case plus a limiting condition. It is based on the idea of breaking a problem up into smaller, self-similar problems.

  • A recursive method is one that calls itself. It is usually defined in terms of a base case, or limiting case that stops the recursive process and a recursive case, that breaks the method into a smaller, self-similar copy of itself. A recursion parameter is generally used to control the recursion.

  • An iterative algorithm is one that uses a loop as its control structure. Any algorithm that can be done iteratively can also be done recursively, and vice versa.

  • Because method calling is relatively costly in terms of both memory used and CPU time involved, a recursive algorithm is generally less efficient than an iterative one that does the same thing.

  • In designing recursive algorithms, the base case defines a limit. Each level of recursion should make progress toward the limit, and the algorithm should eventually reach the limit. The limit is usually expressed in terms of the recursion parameter.


  • [Page 595]
  • A recursive method is tail recursive if and only if each of its recursive calls is the last action executed by the method.

  • A Swing JComboBox component is used to represent a GUI drop-down menu.




Java, Java, Java(c) Object-Orienting Problem Solving
Java, Java, Java, Object-Oriented Problem Solving (3rd Edition)
ISBN: 0131474340
EAN: 2147483647
Year: 2005
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net