Hi everyone,I am in trouble in solving ackermann function..The is like this:
int Acker(int m, int n)
if (m == 0)
return (n + 1);
else if (n == 0)
return (Acker(m - 1,1));
return (Acker(m - 1,Acker(m,n - 1)));
In this,i have to find out those numbers,on which this function fails to produce result.Means that if i have taken two integer numbers,then if the result is much larger that integer can not hold that result.For example if integer range is 32767 than i have to find that number on which it fails.
Problem is that when I call the function with value(4,2),then program hang out in continous recursion..Can anyone have idea to how to catch the stack overflow error when the program starts to hang...is there any library related to stack.???