Ackermanns function is defined recursively on non-negative integers as follows. A(m,n) = n+1 if m == 0
Fantastic news! We've Found the answer you've been seeking!
Question:
Ackermann’s function is defined recursively on non-negative integers as follows.
A(m,n) = n+1 if m == 0
A(m,n) = A(m-1, 1) if m != 0, n == 0
A(m,n) = A(m-1, A(m, n-1)) if m != 0, n != 0
Implement it as a recursive function Ackermann(M,N) which takes two positive integers as input and returns a positive integer as result. Once implemented test your program by evaluating Ackermann(2,2).
Related Book For
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi
Posted Date: