SDEV140 -- Chapter 13
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
6
Which of the following can be solved with recursion?
All of these
The total number of times a module calls itself recursively is known as the ________ of recursion.
Depth
The choice between using recursion or a loop is primarily a ________ decision.
Design
When the recursive module makes the last call to itself, the If-Then statements condition expression is ________.
False
The first step in setting up a recursive module is to ________.
Identify at least one case in which the problem can be solved without recursion
When module A is calling module B and module B calls module A, it is called ________ recursion.
Indirect
If a recursive module has no code to stop it from repeating then it is like a ________ loop.
Infinite
Each time a recursive module calls itself, it creates a new ________ of the parameters of the modules.
Instance
A recursive module is similar to a(n) ________ in that it must have some way to control the number of times it repeats.
Loop structure
The majority of repetitive programming tasks are best done with which of the following?
Loops
A ________ module is a type of module that calls itself.
Recursive
In the ________ case the problem is reduced to a smaller version of the original problem.
Recursive
Recursion can be a powerful tool for solving ________ problems.
Repetitive
If a recursive module calls itself ten times, after the tenth call it returns to the ________.
ninth call