Understanding Recursion Concepts

Understanding Recursion Concepts

Assessment

Interactive Video

•

Computers

•

11th Grade

•

Easy

Created by

Dana Paz

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a recursive method?

A method that returns a value

A methods that calls itself

A method that takes no arguments

A method that uses iteration

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Recursion can be a substitute for...

addition

subtraction

iteration

multiplication

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one disadvantage of recursion?

It is difficult to read.

It is always slower than iteration.

It sometimes uses more memory.

It cannot be used with sorting algorithms.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is try about a recursive method?

It must have a return type of void.

It calls itself directly or indirectly.

It cannot have any parameters.

It must be defined within a separate class.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the most important part of a recursive method in Java?

The method signature

The recursive call

The base call

The access modifier

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a recursive method in Java does not have a base case, or if the base case is never reached?

The program will crash.

The method will return null.

The program may throw a StackOverflowError.

The program will enter an infinite loop, but will not crash.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the Java code snippet:
What does this method calculate?

The factorial of n

The sum of numbers 1 to n

n raised to the power of 2

The sum of even numbers from 0 to n

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?