Skip to content

Instantly share code, notes, and snippets.

@Gosha
Created February 14, 2014 11:40
Show Gist options
  • Save Gosha/8999711 to your computer and use it in GitHub Desktop.
Save Gosha/8999711 to your computer and use it in GitHub Desktop.
Mututal recursion from wikipedia
# http://en.wikipedia.org/wiki/Mutual_recursion
bool is_even(unsigned int n)
if (n == 0)
return true;
else
return is_odd(n - 1);
bool is_odd(unsigned int n)
if (n == 0)
return false;
else
return is_even(n - 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment