ackermann¶
Example implementations for Ackermann’s function.
- boring_math.recursive_functions.ackermann.ackermann_list(m: int, n: int) int¶
Ackermann’s Function
- param m:
First argument to Ackermann’s function.
- param n:
Second argument to Ackermann’s function.
- returns:
A very hard to calculate useless value.
Note
This implementation models the recursion with a Python list instead of Python’s call stack. It then evaluates the innermost ackermann function first. To naively use call stack recursion would quickly result in a stack overflow.