× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
1
1
l
1
z
1
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 37 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
Brilliant
wrote...

Yesterday
Good timing, thanks!
wrote...

2 hours ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  878 People Browsing
Related Images
  
 1669
  
 1680
  
 317
Your Opinion