Exam 15: Recursion
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures II Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes43 Questions
Exam 13: Overloading and Templates41 Questions
Exam 14: Exception Handling42 Questions
Exam 15: Recursion41 Questions
Exam 16: Searching and Sorting46 Questions
Exam 17: Linked Lists41 Questions
Exam 18: Stacks and Queues42 Questions
Select questions type
Suppose that function A calls function B, function B calls function C, function C calls function D, and function D calls function A. Function A is then ____________________ recursive.
Free
(Short Answer)
4.8/5
(38)
Correct Answer:
indirectly
The following is a valid recursive definition to determine the factorial of a non-negative integer.


Free
(True/False)
4.8/5
(40)
Correct Answer:
True
Consider the following definition of the recursive function mystery. What is the output of the following statement?
Cout << mystery(5) << endl;


Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
A
Which of the following solution methods would be the best choice for a mission control system?
(Multiple Choice)
4.7/5
(41)
Consider the following definition of the recursive function mystery.
What is the output of the following statement?
Cout << mystery(6, 10) << endl;

(Multiple Choice)
4.9/5
(34)
The ____ case is the case for which the solution to an equation is obtained directly.
(Multiple Choice)
4.8/5
(38)
-Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(3, 7) << endl;

(Multiple Choice)
4.8/5
(28)
-Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << recFunc(8) << endl;

(Multiple Choice)
4.8/5
(38)
Consider the following code.
int fact(int num)
{
if (num == 0)
return 1;
else
return num * fact(num - 1);
}
The function fact is an example of a(n) ____________________ recursive function.
(Short Answer)
4.8/5
(34)
A definition in which something is defined in terms of a smaller version of itself is called a(n) ____ definition.
(Multiple Choice)
4.8/5
(35)
You can use a recursive algorithm to find the largest element in an array.
(True/False)
4.8/5
(34)
____ control structures use a looping structure, such as while, for, or do...while, to repeat a set of statements.
(Multiple Choice)
4.7/5
(36)
Every call to a recursive function requires the system to allocate memory for the local variables and formal parameters.
(True/False)
4.8/5
(39)
To design a recursive function, you must determine the limiting conditions.
(True/False)
4.9/5
(35)
The ____________________ Fibonacci number in a sequence is the sum of the second and third Fibonacci numbers.
(Short Answer)
4.8/5
(35)
Which of the following function headings can be used for a recursive definition of a function to calculate the nth Fibonacci number?
(Multiple Choice)
4.8/5
(43)
Recursive algorithms are implemented using ____________________ functions.
(Short Answer)
4.8/5
(45)
-Consider the accompanying definition of the recursive function mystery. Given the declaration: int alpha[5] = {1, 4, 5, 8, 9};
What is the output of the following statement?
Cout << mystery(alpha, 0, 4) << endl;
![-Consider the accompanying definition of the recursive function mystery. Given the declaration: int alpha[5] = {1, 4, 5, 8, 9}; What is the output of the following statement? Cout << mystery(alpha, 0, 4) << endl;](https://storage.examlex.com/TB4784/11ece012_362f_fb07_9115_312a2d1370b0_TB4784_00.jpg)
(Multiple Choice)
4.7/5
(36)
Showing 1 - 20 of 41
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)