× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
j
4
m
4
4
4
n
3
m
3
R
3
V
3
e
3
w
3
j
3
a
3
New Topic  
DePeet DePeet
wrote...
Posts: 338
Rep: 0 0
6 years ago
Consider the following recursive sum method:
   public int sum(int x)
   {
      if (x == 0) return 0;
      else return sum(x - 1) + 1;
   }
If the base case is replaced with if (x == 1) return 1; the method will still compute the same thing.
Read 42 times
1 Reply
Replies
Answer verified by a subject expert
StingerStinger
wrote...
Posts: 310
Rep: 4 0
6 years ago
Sign in or Sign up in seconds to unlock everything for free
1

Related Topics

DePeet Author
wrote...

6 years ago
Good timing, thanks!
wrote...

Yesterday
Just got PERFECT on my quiz
wrote...

2 hours ago
Helped a lot
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  984 People Browsing
Related Images
  
 388
  
 1690
  
 350
Your Opinion
Where do you get your textbooks?
Votes: 447

Previous poll results: How often do you eat-out per week?