Content deleted Content added
No edit summary |
No edit summary |
||
Line 22:
{{quote|text=If you have two mutually-recursive functions that both alter the state of an object, try to move almost all the functionality into just one of the functions. Otherwise you will probably end up duplicating code.|sign=Peter Norvig <ref>[http://norvig.com/sudoku.html Solving Every Sudoku Puzzle]</ref>}}
Any mutual recursion can be converted to direct recursion using procedural inlining.<ref>[http://delivery.acm.org/10.1145/180000/176510/p151-kaser.pdf?key1=176510&key2=1857140721&coll=GUIDE&dl=GUIDE&CFID=82873082&CFTOKEN=54657523 On the Conversion of Indirect to Direct Recursion] by Owen Kaser, C. R. Ramakrishnan, and Shaunak Pawagi at [[State University of New York, Stony Brook]] (1993)</ref>
In mathematics, the [[Hofstadter sequence#Hofstadter Female and Male sequences|Hofstadter Female and Male sequences]] are an example of a pair of integer sequences defined in a mutually recursive manner.
|