× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
8
5
z
4
n
4
t
4
3
k
3
x
3
r
3
m
3
j
3
c
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 41 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
This site is awesome
wrote...

2 hours ago
Smart ... Thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  916 People Browsing
Related Images
  
 289
  
 445
  
 268
Your Opinion
What percentage of nature vs. nurture dictates human intelligence?
Votes: 436

Previous poll results: Who's your favorite biologist?