David Freed wrote:how can i change the dedicated the memory dedicated? I searched to find a way to change the dedicated memory in eclipse,but i coudnt find anything.
As Ulf says, it won't help you, since recursion depth
also increases exponentially (possibly even by stacked powers). Your only real solution therefore is
not to use recursion at all - and
BigInteger's, not
longs - and even then, you're likely to be able to blow BigInteger's size limit with relatively small values - that is, if you're willing to wait.
Ackermann was discovered as proof that not all computable functions are primitive recursible, so it stands to reason that you're unlikely to be able to use POR (plain old recursion) to get it done. And the numbers involved (stacked powers of 2, if memory serves) quickly get beyond the point of comprehension, let alone storage. A BigInteger can store a Googol, but not a
Googolplex; and Ackermann will quickly take you beyond that.
Perhaps something more grounded in reality might be better; or alternatively, write a program that prints out
what it will need to do (or at least the first few "stacks") to calculate the value.
HIH
Winston