Recursive Trace Java

Recursive Trace Java

Assessment

Interactive Video

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Myra Deister

Used 2+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the name of the recursive method discussed?

recursion

mystery

trace

integer

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the base case for this recursive method?

If n is greater than zero

If n is equal to zero

If n is less than zero

If n is a positive number

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What value does the method return in the base case?

0

1

2

4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many recursive calls does this method make in its recursive case?

1

2

3

4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What initial value of n is used to trace through the method?

2

3

4

5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the recursive calls made when n is 2?

mystery(1) and mystery(-1)

 mystery(1) and mystery(0)

mystery(0) and mystery(-2)

mystery(2) and mystery(-1)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of mystery(0)?

2

4

6

8

Access all questions and much more by creating a free account

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?