Question: Programming Challenge 4, Recursion Evaluation Function 15 points You can use this Recursion Evaluation function, a recursive mathematical algorithm, to test how well a computer

 Programming Challenge 4, Recursion Evaluation Function 15 points You can use

Programming Challenge 4, Recursion Evaluation Function 15 points You can use this Recursion Evaluation function, a recursive mathematical algorithm, to test how well a computer performs recursion. Write a method recursionEvaluation(m, n) that uses the following logic in your method:

If m = 0 then return n + 1

If n = 0 then return recursionEvaluation (m - 1, 1)

Otherwise, return recursionEvaluation (m - 1, recursionEvaluation (m, n - 1)) Test your method in a program that displays the return values of the following method calls:

recursionEvaluation (0, 0)

recursionEvaluation (1, 3)

recursionEvaluation (0, 1)

recursionEvaluation (2, 2)

recursionEvaluation (1, 1)

recursionEvaluation (3, 2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!