Quiz on Recursive Functions

Quiz on Recursive Functions

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Jyo D

FREE Resource

Student preview

quiz-placeholder

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a recursive function?

A function that returns a value

A function that loops through an array

A function that calls itself

A function that calls another function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the base case in recursion?

The main function

The last call of the function

The first call of the function

The condition that stops the recursion

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of a problem that can be solved using recursion?

Searching for an element in a list

Sorting an array

Calculating the factorial of a number

Finding the maximum number in an array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of the recursive Fibonacci function?

O(log n)

O(n)

O(n^2)

O(2^n)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main advantage of using recursion over loops?

Recursion uses less memory

Recursion is easier to understand

Recursion can simplify code for complex problems

Recursion is always faster

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the context of recursion, what does 'tail recursion' mean?

The function does not call itself

The recursive call is the first operation in the function

The recursive call is the last operation in the function

The function calls another function

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a use case for recursion?

Finding the minimum value in an array

Tower of Hanoi

N Queens Problem

Binary search

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?