Question: Consider the following code: public int mystery (int j) { if (j> 0) return 1; else return j + mystery (j+5); } // line
Consider the following code: public int mystery (int j) { if (j> 0) return 1; else return j + mystery (j+5); } // line 1 // line 2 // line 3 // line 4 // line 5 // line 6 What is the result of the method call mystery(-10)? Which line number represents the base case? Which line number represents the general/recursive case? I For
Step by Step Solution
3.55 Rating (162 Votes )
There are 3 Steps involved in it
Answer Lets analyze the method call mystery10 mystery10 is called j is 10 and its not greater t... View full answer
Get step-by-step solutions from verified subject matter experts
