wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

BCSC0006 - Quiz 3 - Recursion

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Name the condition at which the recursive method will stop calling itself.

a)

Base case

b)

Worst Case

c)

Best Case

d)

None of the above

2.

The program may run out of memory in a

a)

non-recursive function call

b)

recursive function call

c)

condition when too many variables are declared

d)

none of the above

3.

Which of the following condition is true?

a)

Recursion is always better than iteration.

b)

Recursion uses more memory as compared to iteration.

c)

Recursion uses less memory as compared to iteration.

d)

Iteration is always better and simpler than recursion.

4.

Which data structure is required to perform recursion?

a)

Queue

b)

Stack

c)

LinkedList

d)

Graph

5.

A recursive method is a method in which the solution of a problem depends upon

a)

smaller instance of the same problem

b)

larger instances of the same problem

c)

smaller instance of different problem

d)

larger instances of different problem

6.

Which of the following problems can be solved using recursion?

a)

finding Nth number of the Fibonacci sequence

b)

finding the factorial of a number

c)

finding the length of a string

d)

all of the above

7.

Recursion is similar to which of the following?

a)

if-else

b)

switch-case

c)

loops

d)

none of the above

8.

What would happen if the base case if not defined in the recursive method?

a)

Stack Overflow

b)

Stack Underflow

c)

Program Crashes

d)

None of the above

9.

The number of recursive calls is limited to the ____ of the stack.

a)

time

b)

ability

c)

quality

d)

size

10.

Recursion is memory intensive because

a)

recursive methods declare a lot of variables

b)

previous stack frames are still active when a new call is made

c)

many copies of the code are created

d)

none of the above