Solved

Why Is the Following Method One Which Has Infinite Recursion

Question 11

Multiple Choice

Why is the following method one which has infinite recursion? public int infiniteRecursion(int n)
{
If (n > 0) return infiniteRecursion(n) + 1;
Else return 0;
}


A) because there is no base case
B) because the base case will never be true
C) because the recursive call does not move the parameter closer to the base case
D) because the recursive call moves the problem further away from the base case
E) None of these; this method isn't infinitely recursive

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents