Created
February 14, 2014 11:40
-
-
Save Gosha/8999711 to your computer and use it in GitHub Desktop.
Mututal recursion from wikipedia
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
# 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