Deck 13: Recursion

Full screen (f)
exit full mode
Question
A recursive module is similar to a ________ in that it must have some way to control the number of times it repeats.

A)Loop structure
B)Case structure
C)If-Then structure
D)If-Then-Else structure
E)None of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following is a mathematical game that is often used in computer science textbooks to demonstrate the power of recursion?

A)Rubik's Cube
B)Chess
C)Blackjack
D)Hangman
E)The Towers of Hanoi
Question
The total number of times a module calls itself recursively is known as the ________ of recursion.

A)Height
B)Weight
C)Time
D)Depth
E)None of the above
Question
The process of calling a module requires several actions to be performed by the computer and is referred to as ____________.

A)Overhead
B)Maintenance
C)memory intensive
D)Inefficiency
E)None of the above
Question
A ____________ module is a type of module that calls itself.

A)Numeric
B)String
C)Recursive
D)Library
E)None of the above
Question
When module A is calling module B and module B calls module A,it is called ___________ recursion.

A)B to A and A to B call
B)A to B and B to A call
C)Loop
D)Indirect
E)None of the above
Question
In the _________ case the problem is reduced to a smaller version of the original problem.

A)Base
B)Recursive
C)Loop
D)Return
E)None of the above
Question
The first step in setting up a recursive module is to ________________________________.

A)Identify at least one case in which the problem can be solved with recursion.
B)Identify at least one case in which the problem can be solved without recursion.
C)Identify the case with the repetitive block
D)Identify the case without the repetitive block
E)None of the above
Question
Recursion can be a powerful tool for solving ____________ problems.

A)Complex decision
B)Repetitive
C)Multiple selections
D)Mathematical
E)None of the above
Question
Which of the following can be solved with recursion?

A)Finding the greatest common divisor
B)Binary search
C)The Fibonacci Series
D)None of the above
E)All of the above
Question
Comparing the recursive algorithm of a binary search with its counterpart,without recursion,it is much more elegant and easier to understand.
Question
The majority of repetitive programming tasks are best done with which of the following?

A)Loops
B)Decision structures
C)Recursion
D)Sequence structures
E)All of the above
Question
Each time a recursive module calls itself,it creates a new _________ of the parameters of the modules.

A)Object
B)Instance
C)Events
D)Memory location(s)
E)None of the above
Question
If a recursive module calls itself ten times,after the tenth call it returns to the __________.

A)End of the module
B)ninth call
C)first call
D)End of the program
E)None of the above
Question
When the recursive module makes the last call to itself,the If-Then statement's condition expression is _________.

A)false
B)True
C)1
D)0
E)Unpredictable
Question
If a recursive module has no code to stop it from repeating then it is like a ____________ loop.

A)Iterative
B)While
C)Infinite
D)Do-While
E)Do-Until
Question
In the following example,how many times does the module calls itself?
Module main ()
Call Welcome (5)
End Module
Module Welcome (Integer number)
If number > 0 Then
Display "Welcome to our store."
Call Welcome (number - 1)
End If
End Module

A)5
B)6
C)7
D)8
E)0
Question
A problem can be solved with recursion if it can be broken down into ____________ that are identical to the overall problem.

A)Successive smaller problems
B)Successive smaller modules
C)Smaller problems
D)Smaller modules
E)None of the above
Question
The choice between using recursion or a loop is primarily a __________ decision.

A)Design
B)Case
C)Group
D)Any of the above
E)None of the above
Question
Recursive algorithms are more efficient that iterative algorithms.
Question
When a recursive algorithm terminates its nth instance of the module call,it returns to the point in the __________ instance directly after the recursive module call.
Question
If a recursive module does not have an incorrect conditional expression,the module is like a(n)___________ loop.
Question
In a recursive algorithm,the computer completes the base case first and then works on the recursive cases.
Question
In a recursive call,the computer actions of setting up memory for parameters and local variables and storing the address of the program location where control returns after the module terminates is called ______________.
Question
____________________ is a powerful tool for solving some repetitive problems.
Question
The _______ is the number of times a recursive module calls itself.
Question
When creating a recursive algorithm it is optional to identify the base case and the recursive case of the algorithm.
Question
There can be several modules involved in a recursive algorithm.
Question
The recursive calls stop when the conditional expression becomes _________.
Question
It is not necessary to have a conditional expression to terminate the recursive calls.
Question
One of the advantages of a recursive algorithm is that it does not matter how many recursive calls are made to a module; only one instance of the parameters are needed.
Question
A recursive algorithm is never required to solve a problem.
Question
The depth of recursion refers to the length and complexity of the recursive algorithm.
Question
It is possible for a module to call itself.
Question
When a recursive module calls only itself,it is called a ___________ recursion.
Question
When,in a recursive algorithm,module A calls module B,module B calls module C,which calls module A,it is called ___________ recursion.
Question
Each time a module is called recursively,a new _________ of the parameters are created.
Question
The term callback potential refers to number of times a module calls itself.
Question
A module that calls itself is known as a _____________ module.
Question
The Fibonacci Series is a well-known mathematical problem that is solved recursively.
Question
When setting up a recursive module,the part of the problem that can be solved without recursion is known as the __________ case.
Question
Recursive algorithms can be written with modules or _____________ with a return value.
Question
If a module has called itself six times,the depth of recursion was ____________.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/43
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 13: Recursion
1
A recursive module is similar to a ________ in that it must have some way to control the number of times it repeats.

A)Loop structure
B)Case structure
C)If-Then structure
D)If-Then-Else structure
E)None of the above
A
2
Which of the following is a mathematical game that is often used in computer science textbooks to demonstrate the power of recursion?

A)Rubik's Cube
B)Chess
C)Blackjack
D)Hangman
E)The Towers of Hanoi
E
3
The total number of times a module calls itself recursively is known as the ________ of recursion.

A)Height
B)Weight
C)Time
D)Depth
E)None of the above
D
4
The process of calling a module requires several actions to be performed by the computer and is referred to as ____________.

A)Overhead
B)Maintenance
C)memory intensive
D)Inefficiency
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
5
A ____________ module is a type of module that calls itself.

A)Numeric
B)String
C)Recursive
D)Library
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
6
When module A is calling module B and module B calls module A,it is called ___________ recursion.

A)B to A and A to B call
B)A to B and B to A call
C)Loop
D)Indirect
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
7
In the _________ case the problem is reduced to a smaller version of the original problem.

A)Base
B)Recursive
C)Loop
D)Return
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
8
The first step in setting up a recursive module is to ________________________________.

A)Identify at least one case in which the problem can be solved with recursion.
B)Identify at least one case in which the problem can be solved without recursion.
C)Identify the case with the repetitive block
D)Identify the case without the repetitive block
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
9
Recursion can be a powerful tool for solving ____________ problems.

A)Complex decision
B)Repetitive
C)Multiple selections
D)Mathematical
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
10
Which of the following can be solved with recursion?

A)Finding the greatest common divisor
B)Binary search
C)The Fibonacci Series
D)None of the above
E)All of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
11
Comparing the recursive algorithm of a binary search with its counterpart,without recursion,it is much more elegant and easier to understand.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
12
The majority of repetitive programming tasks are best done with which of the following?

A)Loops
B)Decision structures
C)Recursion
D)Sequence structures
E)All of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
13
Each time a recursive module calls itself,it creates a new _________ of the parameters of the modules.

A)Object
B)Instance
C)Events
D)Memory location(s)
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
14
If a recursive module calls itself ten times,after the tenth call it returns to the __________.

A)End of the module
B)ninth call
C)first call
D)End of the program
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
15
When the recursive module makes the last call to itself,the If-Then statement's condition expression is _________.

A)false
B)True
C)1
D)0
E)Unpredictable
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
16
If a recursive module has no code to stop it from repeating then it is like a ____________ loop.

A)Iterative
B)While
C)Infinite
D)Do-While
E)Do-Until
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
17
In the following example,how many times does the module calls itself?
Module main ()
Call Welcome (5)
End Module
Module Welcome (Integer number)
If number > 0 Then
Display "Welcome to our store."
Call Welcome (number - 1)
End If
End Module

A)5
B)6
C)7
D)8
E)0
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
18
A problem can be solved with recursion if it can be broken down into ____________ that are identical to the overall problem.

A)Successive smaller problems
B)Successive smaller modules
C)Smaller problems
D)Smaller modules
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
19
The choice between using recursion or a loop is primarily a __________ decision.

A)Design
B)Case
C)Group
D)Any of the above
E)None of the above
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
20
Recursive algorithms are more efficient that iterative algorithms.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
21
When a recursive algorithm terminates its nth instance of the module call,it returns to the point in the __________ instance directly after the recursive module call.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
22
If a recursive module does not have an incorrect conditional expression,the module is like a(n)___________ loop.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
23
In a recursive algorithm,the computer completes the base case first and then works on the recursive cases.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
24
In a recursive call,the computer actions of setting up memory for parameters and local variables and storing the address of the program location where control returns after the module terminates is called ______________.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
25
____________________ is a powerful tool for solving some repetitive problems.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
26
The _______ is the number of times a recursive module calls itself.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
27
When creating a recursive algorithm it is optional to identify the base case and the recursive case of the algorithm.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
28
There can be several modules involved in a recursive algorithm.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
29
The recursive calls stop when the conditional expression becomes _________.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
30
It is not necessary to have a conditional expression to terminate the recursive calls.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
31
One of the advantages of a recursive algorithm is that it does not matter how many recursive calls are made to a module; only one instance of the parameters are needed.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
32
A recursive algorithm is never required to solve a problem.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
33
The depth of recursion refers to the length and complexity of the recursive algorithm.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
34
It is possible for a module to call itself.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
35
When a recursive module calls only itself,it is called a ___________ recursion.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
36
When,in a recursive algorithm,module A calls module B,module B calls module C,which calls module A,it is called ___________ recursion.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
37
Each time a module is called recursively,a new _________ of the parameters are created.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
38
The term callback potential refers to number of times a module calls itself.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
39
A module that calls itself is known as a _____________ module.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
40
The Fibonacci Series is a well-known mathematical problem that is solved recursively.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
41
When setting up a recursive module,the part of the problem that can be solved without recursion is known as the __________ case.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
42
Recursive algorithms can be written with modules or _____________ with a return value.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
43
If a module has called itself six times,the depth of recursion was ____________.
Unlock Deck
Unlock for access to all 43 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 43 flashcards in this deck.