MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / Ackermann

Function Ackermann

Recursion/Ackermann.py:1–7  ·  view source on GitHub ↗
(m, n)

Source from the content-addressed store, hash-verified

1def Ackermann(m, n):
2 if m == 0:
3 return n + 1
4 elif m > 0 and n == 0:
5 return Ackermann(m - 1, 1)
6 else:
7 return Ackermann(m - 1, Ackermann(m, n - 1))
8m = int(input())
9n = int(input())
10print(Ackermann(m, n))

Callers 1

Ackermann.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected