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 Classes44 Questions
Exam 13: Operator Overloading and Templates41 Questions
Exam 14: Exception Handling43 Questions
Exam 15: Recursion43 Questions
Exam 16: Linked Lists40 Questions
Exam 17: Stacks and Queue43 Questions
Exam 18: Searching and Sorting Algorithms40 Questions
Exam 19: Binary Trees43 Questions
Exam 20: Graph Algorithms48 Questions
Exam 21: Standard Template Library41 Questions
Select questions type
Every call to a recursive function requires the system to allocate memory for the local variables and formal parameters.
Free
(True/False)
4.9/5
(36)
Correct Answer:
True
Consider the following code.
The function fact is an example of a(n) ____________________ recursive function.

Free
(Short Answer)
4.8/5
(29)
Correct Answer:
tail
Consider the following definition of the recursive function print. What is the output of the following statement?
Print(4);


Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
C
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.9/5
(37)
The ____________________ Fibonacci number in a sequence is the sum of the second and third Fibonacci numbers.
(Short Answer)
4.9/5
(34)
-Consider the accompanying definition of the recursive function mystery.Given the declaration:int beta[10] = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25}; What is the output of the following statement?
Cout << mystery(beta, 4, 7) << endl;
![-Consider the accompanying definition of the recursive function mystery.Given the declaration:int beta[10] = {2, 5, 8, 9, 13, 15, 18, 20, 23, 25}; What is the output of the following statement? Cout << mystery(beta, 4, 7) << endl;](https://storage.examlex.com/TB4785/11ecdff4_c6e0_374b_9115_e99fe0e7e14a_TB4785_00.jpg)
(Multiple Choice)
4.9/5
(44)
-Consider the accompanying definition of a recursive function.What is the output of the following statement? cout << recFunc(10) << endl;

(Multiple Choice)
4.9/5
(38)
Which of the following rules should you follow to solve the Tower of Hanoi problem?
(Multiple Choice)
4.8/5
(43)
The following is an example of a recursive function, where nextNum is a function such that nextNum(x) = x + 1.


(True/False)
4.9/5
(41)
With recursion, the base case must eventually be reduced to a general case.
(True/False)
4.9/5
(33)
Tracing through ____ recursion is more tedious than tracing other recursive forms.
(Multiple Choice)
4.8/5
(35)
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.8/5
(31)
In the Tower of Hanoi recursive program, if needle 1 contains three disks, then the number of moves required to move all three disks from needle 1 to needle 3 is 8.
(True/False)
4.8/5
(34)
The following is a valid recursive definition to determine the factorial of a non-negative integer.


(True/False)
4.7/5
(47)
____ control structures use a looping structure, such as while, for, or do...while, to repeat a set of statements.
(Multiple Choice)
4.8/5
(35)
-Consider the accompanying definition of a recursive function.Which of the statements represents the base case?

(Multiple Choice)
4.8/5
(35)
In the Tower of Hanoi problem, if needle 1 contains three disks, then the number of moves required to move all three disks from needle 1 to needle 3 is ____________________.
(Short Answer)
4.7/5
(39)
If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion.
(Multiple Choice)
4.8/5
(38)
If you execute an infinite recursive function on a computer, the function executes until the system runs out of ____________________.
(Short Answer)
4.8/5
(36)
Recursive algorithms are implemented using ____________________ functions.
(Short Answer)
4.9/5
(33)
Showing 1 - 20 of 43
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)