Recursion Function Usage

Recursion Function Usage

University

10 Qs

quiz-placeholder

Similar activities

Class 12 Recursion

Class 12 Recursion

12th Grade - University

10 Qs

Control Structures

Control Structures

University

14 Qs

Stack2

Stack2

University

10 Qs

Topic 4 - Recursive

Topic 4 - Recursive

University

10 Qs

PDS - 04225 - Recursion - Chapter 12

PDS - 04225 - Recursion - Chapter 12

University

10 Qs

Weekly Contest #10 - TechXNinjas

Weekly Contest #10 - TechXNinjas

University

10 Qs

Coding - Advanced Level

Coding - Advanced Level

8th Grade - Professional Development

11 Qs

BCSC0006 - Quiz 3 - Recursion

BCSC0006 - Quiz 3 - Recursion

University

10 Qs

Recursion Function Usage

Recursion Function Usage

Assessment

Quiz

Mathematics, Computers

University

Hard

Created by

Yomna Elkholy

Used 4+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A function that is called by itself, either directly or indirectly is called a

Super function

Recursive function

Main function

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following problems can’t be solved using recursion?

Factorial of a number

Nth Fibonacci number

Length of a string

Problems without base case

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In recursion, the condition for which the function will stop calling itself is ___________

Best case

Worst case

Base case

There is no such condition

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will happen when the following code is executed?

The code will be executed successfully and no output will be generated

The code will be executed successfully and random output will be generated

The code will show a compile time error

The code will run for some time and stop when the stack overflows

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

10

1

10 9 8 … 1 0

10 9 8 … 1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the base case of the program?

return

printf(“%d “, n)

if(n == 0)

my_recursive_function(n-1)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true?

Recursion is always better than iteration

Recursion uses more memory compared to iteration

Recursion uses less memory compared to iteration

Iteration is always better and simpler than recursion

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?