Exam 19: Recursion
Exam 1: Introduction to Computers and Programming44 Questions
Exam 2: Introduction to C++56 Questions
Exam 3: Expressions and Interactivity44 Questions
Exam 4: Making Decisions53 Questions
Exam 5: Loops and Files62 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays53 Questions
Exam 8: Searching and Sorting Arrays20 Questions
Exam 10: Characters, C++-Strings, and More About the String Class42 Questions
Exam 11: Structured Data43 Questions
Exam 11: Structured Data50 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes46 Questions
Exam 14: More About Classes40 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions38 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library STL39 Questions
Exam 17: Linked Lists40 Questions
Exam 18: Stacks and Queues46 Questions
Exam 19: Recursion21 Questions
Exam 20: Binary Trees38 Questions
Select questions type
The recursive factorial function calculates the factorial of its parameter. Its base case is when the parameter is _______.
Free
(Multiple Choice)
4.8/5
(89)
Correct Answer:
D
How many times will the following function call itself, if 5 is passed as the argument? void showMessage(int n)
{
If (n > 0)
{
Cout << "Good day!" << endl;
ShowMessage(n - 1);
}
}
Free
(Multiple Choice)
4.9/5
(86)
Correct Answer:
C
The QuickSort algorithm is used to sort _____________.
Free
(Multiple Choice)
4.7/5
(91)
Correct Answer:
A
The __________ algorithm uses recursion to efficiently sort a list.
(Multiple Choice)
4.8/5
(77)
Recursive algorithms are less efficient than iterative algorithms.
(True/False)
4.9/5
(68)
A recursive function that does not have a termination will eventually
(Multiple Choice)
5.0/5
(81)
When function A calls function B, which in turn calls function A, this is known as:
(Multiple Choice)
4.8/5
(69)
How many times will the following function call itself, if 5 is passed as the argument? void showMessage(int n)
{
If (n > 0)
{
Cout << "Good day!" << endl;
ShowMessage(n + 1);
}
}
(Multiple Choice)
4.9/5
(80)
The __________ of recursion is the number of times a recursive function calls itself.
(Multiple Choice)
4.7/5
(82)
The speed and amount of memory available to modern computers diminishes the performance impact of recursion so much that inefficiency is no longer a strong argument against it.
(True/False)
4.8/5
(83)
When a recursive function directly calls itself, this is known as direct recursion.
(True/False)
4.8/5
(71)
A recursive function is designed to terminate when it reaches its ________.
(Multiple Choice)
4.9/5
(77)
Any algorithm that can be coded with recursion can also be coded with an iterative structure.
(True/False)
4.8/5
(86)
Indirect recursion means that a function calls itself n number of times, then processing of the function starts from the first call.
(True/False)
4.8/5
(85)
When recursion is used on a linked list, it will always display the contents of the list in reverse order.
(True/False)
4.9/5
(73)
Showing 1 - 20 of 21
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)