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
If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion.
(Multiple Choice)
4.9/5
(33)
-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
(43)
The recursive algorithm must have one or more base cases, and the general solution must eventually be reduced to a(n) ____________________.
(Short Answer)
4.8/5
(37)
Consider the following recursive definition, where n is a positive integer.
The value of F(3) is ____________________.


(Short Answer)
5.0/5
(39)
Consider the following definition of the recursive function print. What is the output of the following statement?
Print(4);


(Multiple Choice)
4.7/5
(35)
If you execute an infinite recursive function on a computer, the function executes until the system runs out of ____________________.
(Short Answer)
4.9/5
(38)
Tracing through ____ recursion is more tedious than tracing other recursive forms.
(Multiple Choice)
4.8/5
(38)
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.8/5
(34)
-Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(5, 10) << endl;

(Multiple Choice)
4.9/5
(42)
-Consider the accompanying definition of a recursive function. Which of the statements represents the base case?

(Multiple Choice)
4.9/5
(34)
With recursion, the base case must eventually be reduced to a general case.
(True/False)
4.8/5
(40)
Which of the following solutions is easier to construct for the Tower of Hanoi problem?
(Multiple Choice)
4.8/5
(33)
-Consider the accompanying definition of a recursive function. Which of the statements represent the general case?

(Multiple Choice)
4.8/5
(31)
-Consider the accompanying definition of a recursive function. Which of the statements represent the general case?

(Multiple Choice)
4.8/5
(31)
A recursive function in which the last statement executed is the recursive call is called a(n) ____ recursive function.
(Multiple Choice)
4.7/5
(43)
If a function A calls a function B and function B calls function A, then function A is ____________________ recursive.
(Short Answer)
4.9/5
(41)
Which of the following rules should you follow to solve the Tower of Hanoi problem?
(Multiple Choice)
4.8/5
(43)
Showing 21 - 40 of 41
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)