Mutual Recursion

Mutual recursion is a form of recursion where two mathematical or computational functions are defined in terms of each other. For instance, consider two functions A(x) and B(x) defined as follows:
   A(x) = 1         (when x≤1)    A(x) = B(x + 2)  (when x>1)  
   B(x) = A(x - 3) + 4  
Mutual recursion is very common in the functional programming style, and is often used for programs written in LISP, Scheme, ML, and similar languages. In languages such as Prolog, mutual recursion is almost unavoidable. Some programming styles discourage mutual recursion, claiming that it can be confusing to distinguish the conditions which will return an answer from the conditions that would allow the code to run forever without producing an answer.

 

<< PreviousWord BrowserNext >>
machine translation
moment about the mean
murad i
mehmed i
murad ii
murad iii
mehmed iii
mustafa i
murad iv
masamune shirow
musical saw
musical instrument digital interface
microprogram
multitier architecture
myrinet
musique concrte
metric space
marine biology
mach
multihull
ms dos
middle helladic
multics relational data store
meriadoc
military history
mike oldfield
metasyntactic variable
mondegreen
merge sort
maule air
morita shoma
montezuma
mac os
mac os history
mooney
minnesota twins
mach number
march 8
march 9
mpeg
mpeg 1
mumia abu jamal
multiplicative function
mpeg 2