× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
a
5
k
5
c
5
B
5
l
5
C
4
s
4
a
4
t
4
i
4
r
4
r
4
New Topic  
Stromile Stromile
wrote...
Posts: 299
Rep: 0 0
5 years ago
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
Read 25 times
1 Reply
Replies
Answer verified by a subject expert
se7ense7en
wrote...
Posts: 327
Rep: 0 0
5 years ago
Sign in or Sign up in seconds to unlock everything for free
1

Related Topics

Stromile Author
wrote...

5 years ago
Helped a lot
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
Thank you, thank you, thank you!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  961 People Browsing
Related Images
  
 108
  
 987
  
 233
Your Opinion
What's your favorite coffee beverage?
Votes: 274

Previous poll results: What's your favorite math subject?