4.1 Recursion (Java)

4.1 Recursion (Java)

Assessment

Quiz

Computers

12th Grade

Practice Problem

Easy

Created by

Valentina Hideg

Used 4+ times

FREE Resource

Student preview

quiz-placeholder

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

___________ is when the recursive method stops calling itself.

Base case

Worst Case

Best Case

Simple Case

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

Stack Overflow

Stack Underflow

Program Crashes

None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the recursive call, the argument should grow/shrink towards the ________.

base case

end

next recursive call

none of the above

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What is returned as a result of the call mystery(4,6)?

2

3

4

1

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?