Self-Review Exercises

15.1State whether each of the following is true or false. If false, explain why.
  1. A method that calls itself indirectly is not an example of recursion.

  2. Recursion can be efficient in computation because of reduced memory-space usage.

  3. When a recursive method is called to solve a problem, it actually is capable of solving only the simplest case(s), or base case(s).

  4. To make recursion feasible, the recursion step in a recursive solution must resemble the original problem, but be a slightly larger version of it.

15.2A __________ is needed to terminate recursion.
  1. recursion step

  2. break statement

  3. void return type

  4. base case

15.3The first call to invoke a recursive method is__________.
  1. not recursive

  2. recursive

  3. the recursion step

  4. none of the above ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.