Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
13 user(s) are online (12 user(s) are browsing encyclopedia)

Members: 0
Guests: 13

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

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)=egin{cases} 1 & , xle1 \ B(x+2) & ,x>1end{cases}

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 programming language, Scheme programming language, ML programming language, and similar programming language. In languages such as Prolog programming language, 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.