Deck 7: Iterators

Full screen (f)
exit full mode
Question
Any recursive definition must have a non-recursive part, called the ___________, which permits the recursion to eventually end.

A) base case
B) foundation
C) primary case
D) first case
Use Space or
up arrow
down arrow
to flip the card.
Question
Recursion is a programming technique in which a ________ calls itself.

A) program
B) method
C) variable
D) parameter
Question
____________ problems and formulas are often expressed recursively.

A) Business
B) Programmatic
C) Variable
D) Mathematical
Question
Each recursive call to a method creates new __________ and __________.

A) Local variables
B) Parameters
C) Methods
D) A and B
Question
A careful _______ of recursive processing can provide insight into the way it is used to solve a problem.

A) review
B) trace
C) observation
D) use
Question
Recursion is the most elegant and appropriate way to solve ________ problems, but for others it is less intuitive than an iterative solution.

A) some
B) most
C) all
D) none of the above
Question
The order of a recursive algorithm can be determined using techniques similar to analyzing ______ processing.

A) programmatic
B) variable
C) iterative
D) interface
Question
The Towers of Hanoi solution has ___________ complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and elegant.

A) quadratic
B) linear
C) exponential
D) none of the above
Question
Recursion is a programming technique in which a method calls ______.
Question
Any recursive definition must have a ______ part, called the base case, which permits the recursion to eventually end.
Question
Mathematical problems and formulas are often expressed ______.
Question
Each recursive call to a method creates ______ local variables and parameters.
Question
The order of a recursive algorithm can be determined using techniques similar to analyzing ______ processing.
Question
The Towers of Hanoi solution has exponential complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and ______.
Question
If method m1 invokes m2 which invokes m3 which invokes m1 again, then this is an example of ______
Question
A recursive definition without a base-case will lead to ______.
Question
Recursion is a programming technique in which a method calls itself.
Question
If a problem can be solved with iteration, it cannot be solved with recursion
Question
Any recursive definition must have a nonrecursive part, called the base case, which permits the recursion to eventually end.
Question
Mathematical problems and formulas are never expressed recursively.
Question
Each recursive call to a method uses the same local variables and parameters.
Question
A careful trace of recursive processing can provide insight into the way it is used to solve a problem.
Question
Recursion is the most elegant and appropriate way to solve some problems, but for others it is less intuitive than an iterative solution.
Question
The order of a recursive algorithm can be determined using techniques similar to analyzing iterative processing.
Question
The Towers of Hanoi solution has quadratic complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and elegant.
Question
One of the reasons recursion is so elegant and effective is that it creates a new set of local variables and parameters with each call.
Question
What is the output of the following program?
Question
What is infinite recursion?
Question
When is a base case needed for recursive processing?
Question
When should recursion be avoided?
Question
What is indirect recursion?
Question
Explain the general approach to solving the Towers of Hanoi puzzle. How does it relate to recursion?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/32
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Iterators
1
Any recursive definition must have a non-recursive part, called the ___________, which permits the recursion to eventually end.

A) base case
B) foundation
C) primary case
D) first case
base case
2
Recursion is a programming technique in which a ________ calls itself.

A) program
B) method
C) variable
D) parameter
method
3
____________ problems and formulas are often expressed recursively.

A) Business
B) Programmatic
C) Variable
D) Mathematical
Mathematical
4
Each recursive call to a method creates new __________ and __________.

A) Local variables
B) Parameters
C) Methods
D) A and B
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
5
A careful _______ of recursive processing can provide insight into the way it is used to solve a problem.

A) review
B) trace
C) observation
D) use
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
6
Recursion is the most elegant and appropriate way to solve ________ problems, but for others it is less intuitive than an iterative solution.

A) some
B) most
C) all
D) none of the above
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
7
The order of a recursive algorithm can be determined using techniques similar to analyzing ______ processing.

A) programmatic
B) variable
C) iterative
D) interface
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
8
The Towers of Hanoi solution has ___________ complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and elegant.

A) quadratic
B) linear
C) exponential
D) none of the above
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
9
Recursion is a programming technique in which a method calls ______.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
10
Any recursive definition must have a ______ part, called the base case, which permits the recursion to eventually end.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
11
Mathematical problems and formulas are often expressed ______.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
12
Each recursive call to a method creates ______ local variables and parameters.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
13
The order of a recursive algorithm can be determined using techniques similar to analyzing ______ processing.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
14
The Towers of Hanoi solution has exponential complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and ______.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
15
If method m1 invokes m2 which invokes m3 which invokes m1 again, then this is an example of ______
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
16
A recursive definition without a base-case will lead to ______.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
17
Recursion is a programming technique in which a method calls itself.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
18
If a problem can be solved with iteration, it cannot be solved with recursion
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
19
Any recursive definition must have a nonrecursive part, called the base case, which permits the recursion to eventually end.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
20
Mathematical problems and formulas are never expressed recursively.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
21
Each recursive call to a method uses the same local variables and parameters.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
22
A careful trace of recursive processing can provide insight into the way it is used to solve a problem.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
23
Recursion is the most elegant and appropriate way to solve some problems, but for others it is less intuitive than an iterative solution.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
24
The order of a recursive algorithm can be determined using techniques similar to analyzing iterative processing.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
25
The Towers of Hanoi solution has quadratic complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and elegant.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
26
One of the reasons recursion is so elegant and effective is that it creates a new set of local variables and parameters with each call.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
27
What is the output of the following program?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
28
What is infinite recursion?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
29
When is a base case needed for recursive processing?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
30
When should recursion be avoided?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
31
What is indirect recursion?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
32
Explain the general approach to solving the Towers of Hanoi puzzle. How does it relate to recursion?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 32 flashcards in this deck.