|
|
| more useful options | |
| PerlMonks |
The Ackermann Functionby swampyankee (Parson) |
| on Jun 20, 2006 at 13:10 UTC ( [id://556481]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.swampyankee has asked for the wisdom of the Perl Monks concerning the following question: Just for grins, I decided to code Ackerman's function in Perl. The definition is really quite simple:
Formal Definition: In my typical Brute Force and Ignorance™ method, I coded this:
When run as ackermann 4 1, I get (many) 'deep recursion' messages. OK; I know that my implementation is less than brilliant; that's not my question. This is my question: Is there any way of predicting what conditions are likely to result in deep recursion messages? added in edit Thanks to ikegami (I've got to try Memoize) and jdhedden. emc
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||