× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
w
3
w
3
e
3
3
r
3
g
2
2
b
2
M
2
V
2
f
2
c
2
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 45 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
You make an excellent tutor!
wrote...

Yesterday
Good timing, thanks!
wrote...

2 hours ago
This calls for a celebration Person Raising Both Hands in Celebration
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1264 People Browsing
Related Images
  
 177
  
 86
  
 3591
Your Opinion
Which 'study break' activity do you find most distracting?
Votes: 824

Previous poll results: Who's your favorite biologist?