× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
e
5
e
4
4
d
4
o
3
p
3
t
3
3
m
3
p
3
m
3
f
3
New Topic  
Stromile Stromile
wrote...
Posts: 299
Rep: 0 0
6 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 26 times
1 Reply
Replies
Answer verified by a subject expert
se7ense7en
wrote...
Posts: 327
Rep: 0 0
6 years ago
Sign in or Sign up in seconds to unlock everything for free
1

Related Topics

Stromile Author
wrote...

6 years ago
this is exactly what I needed
wrote...

Yesterday
Correct Slight Smile TY
wrote...

2 hours ago
Smart ... Thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  907 People Browsing
 101 Signed Up Today
Related Images
  
 285
  
 113
  
 4069
Your Opinion
What's your favorite coffee beverage?
Votes: 299