Ackermanns function is a recursive mathematical algorithm that can be used to test how well a computer

Question:

Ackermann’s function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Write a method ackermann(m,n), which solves Ackermann’s function. Use the following logic in your method:

If m = 0 then return n + 1
If n = 0 then return ackermann(m - 1, 1)
Otherwise, return ackermann(m - 1, ackermann(m, n - 1)) 

Test your method in a program that displays the return values of the following method calls: 

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: