Exam 14: Recursion
Exam 1: Introduction to Computers and Programming40 Questions
Exam 2: Introduction to C Plus Plus40 Questions
Exam 3: Expressions and Interactivity40 Questions
Exam 4: Making Decisions40 Questions
Exam 5: Looping40 Questions
Exam 6: Functions40 Questions
Exam 7: Introduction to Classes and Objects40 Questions
Exam 8: Arrays40 Questions
Exam 9: Searching, Sorting, Algorithm Analysis40 Questions
Exam 10: Pointers62 Questions
Exam 11: More About Classes and Object-Oriented Programming70 Questions
Exam 12: More on C-Strings and the String Class40 Questions
Exam 13: Advanced File and Io Operations40 Questions
Exam 14: Recursion20 Questions
Exam 15: Polymorphism and Virtual Functions22 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library Stl40 Questions
Exam 17: Linked Lists38 Questions
Exam 18: Stacks and Queues36 Questions
Exam 19: Binary Trees38 Questions
Select questions type
The ________ algorithm uses recursion to sort an array.
Free
(Multiple Choice)
4.9/5
(25)
Correct Answer:
B
The quicksort algorithm works on the basis of
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
B
Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will
(Multiple Choice)
4.9/5
(38)
A recursive function should be designed to stop making recursive calls when it reaches its
(Multiple Choice)
5.0/5
(34)
The programmer must ensure that a recursive function does not become
(Multiple Choice)
4.8/5
(35)
The function int fact(int k)
{
Return k*fact(k-1);
If (k==0) return 1;
}
(Multiple Choice)
4.8/5
(42)
When a function A calls a function B, which in turn calls A, we have
(Multiple Choice)
4.7/5
(32)
The ________ of recursion is the number of times a recursive function calls itself.
(Multiple Choice)
5.0/5
(25)
Any algorithm that can be coded with recursion can also be coded using a loop.
(True/False)
4.7/5
(31)
The speed and amount of memory available to modern computers diminishes the performance impact of the overhead of recursion so much that for many applications, this overhead is not noticeable.
(True/False)
4.9/5
(33)
Indirect recursion means that a function calls itself several times.
(True/False)
4.9/5
(24)
When a recursive function directly calls itself, this is known as direct recursion.
(True/False)
5.0/5
(40)
Recursive algorithms tend to be less efficient than iterative algorithms.
(True/False)
4.8/5
(34)
A recursive function that does not correctly handle its base case may
(Multiple Choice)
4.8/5
(23)
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)