Skip to content

Instantly share code, notes, and snippets.

@andylshort
Created July 30, 2019 18:35
Show Gist options
  • Save andylshort/d5dd2a8dc01f2622f989473dbfc99ccb to your computer and use it in GitHub Desktop.
Save andylshort/d5dd2a8dc01f2622f989473dbfc99ccb to your computer and use it in GitHub Desktop.
Ackermann C#
static int Ackermann(int m, int n)
{
if (m == 0)
{
return n + 1;
}
else if (n == 0)
{
return Ackermann(m - 1, 1);
}
else
{
return Ackermann(m - 1, Ackermann(m, n - 1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment