NEW
Font size
WorksheetsBCSC0006 - Quiz 3 - Recursion
Total questions: 10
Worksheet time: 5mins
Name the condition at which the recursive method will stop calling itself.
Base case
Worst Case
Best Case
None of the above
The program may run out of memory in a
non-recursive function call
recursive function call
condition when too many variables are declared
none of the above
Which of the following condition is true?
Recursion is always better than iteration.
Recursion uses more memory as compared to iteration.
Recursion uses less memory as compared to iteration.
Iteration is always better and simpler than recursion.
Which data structure is required to perform recursion?
Queue
Stack
LinkedList
Graph
A recursive method is a method in which the solution of a problem depends upon
smaller instance of the same problem
larger instances of the same problem
smaller instance of different problem
larger instances of different problem
Which of the following problems can be solved using recursion?
finding Nth number of the Fibonacci sequence
finding the factorial of a number
finding the length of a string
all of the above
Recursion is similar to which of the following?
if-else
switch-case
loops
none of the above
What would happen if the base case if not defined in the recursive method?
Stack Overflow
Stack Underflow
Program Crashes
None of the above
The number of recursive calls is limited to the ____ of the stack.
time
ability
quality
size
Recursion is memory intensive because
recursive methods declare a lot of variables
previous stack frames are still active when a new call is made
many copies of the code are created
none of the above
