Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
def
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))
8
m = int(input())
9
n = int(input())
10
print(Ackermann(m, n))
Callers
1
Ackermann.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected