Created
July 6, 2013 10:09
-
-
Save ikautak/5939471 to your computer and use it in GitHub Desktop.
Ackermann function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ack(int m, int n) { | |
if (m == 0) return n + 1; | |
if (n == 0) { | |
return ack(m - 1, 1); | |
} else { | |
return ack(m - 1, ack(m, n - 1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment