java chapter 12 part 1
Recursion is a(n) _________________?
problem-solving method
Recursion is often used when a problem's solution relies on a _________________?
simpler solution to the same problem
A recursive method is a method that _________________?
calls itself
A recursive method _________________?
might contain any number of statements
A useful recursive method must _________________?
provide a way to stop recursion
The approach to writing nonrecursive methods that include loops to produce results is _________________?
Iterative
A programmer might choose an iterative approach to a problem rather than a recursive one because iterative programs often _________________?
run more quickly
The excess computation time required for repeated method calls in recursive programs is called _________________?
overhead
When you use recursion, you frequently ask a method to call itself repeatedly, _________________?
using a simpler version of the problem each time
When a method calls another method, the location to return to when the second method finishes is stored in the _________________?
call stack
In a recursive method, there typically are _________________?
more recursive cases than base cases.
The case in a recursive method that does not make a recursive call is the _________________?
base case
The cases in a recursive method that make recursive calls are the _________________?
recursive cases
The factorial of a nonnegative integer is the _________________ of all the integers from 1 up to and including the integer?
product
Computing factorials lends itself to recursion because _________________?
computing the factorial of any number relies on computing the factorial of a simpler case
In a recursive method, the case in which no recursive call is needed is the _________________?
base case
After using the statement p = n.indexOf('A');, if p contains 5, then _________________?
there is an 'A' in the string n
Recursion can be successfully used to _________________?
solve mathematical problems and to create visual patterns
Which of the following problems would lend itself most clearly to a recursive approach?
displaying a series of characters on consecutive lines where each is one space further to the right than the previous one
You can substitute a recursive solution to a problem for an iterative one _________________?
frequently