Skip to content

Instantly share code, notes, and snippets.

@ikautak
Created July 6, 2013 10:09
Show Gist options
  • Save ikautak/5939471 to your computer and use it in GitHub Desktop.
Save ikautak/5939471 to your computer and use it in GitHub Desktop.
Ackermann function
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