| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice Test
Share
medium Solved by 8 students
Recursive Factorial Method Analysis
< Prev
Next >

Consider the following factorial method. Which statement about the method’s recursive implementation is false?

public int factorial(int n) {
    if (n <= 1)
        return 1;
    else
        return n * factorial(n - 1);
}
A

At each recursive step, the method multiplies n by the factorial of (n - 1).

B

The base case stops recursion when n is less than or equal to 1.

C

The factorial method performs multiple recursive calls simultaneously at each level of recursion.

D

The recursion in the factorial method reduces the problem size by decrementing n with each call.

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1ethan11 0m 17s 83
#2richa.tuli12 0m 30s 60
#3theofanusmischa01 0m 00s -10
#4bommasam00013 2m 12s -52
#5singhris00013 3m 25s -125
APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy