Multiple Choice
For the questions below, refer to the following recursive factorial method.
public int factorial(int x)
{
if (x > 1) return x * factorial (x - 1) ;
else return 1;
}
-What is returned if factorial(0) is called?
A) 0
B) 1
C) 2
D) nothing, factorial(0) causes infinite recursion
E) nothing, factorial(0) produces a run-time error
Correct Answer:

Verified
Correct Answer:
Verified
Q18: We can define a list of int
Q23: The difference between direct and indirect recursion
Q24: As identified in the text, some algorithms
Q25: For the questions below, use the following
Q27: Which of the following recursive methods would
Q28: The following method recognizes whether a String
Q29: Rewrite the following iterative method as a
Q31: The Koch fractal of order 1 is<br>A)
Q33: It always is possible to replace a
Q37: A Koch snowflake of order = 1