Category:Recursion: Difference between revisions

m
formatting
m (Grammar fix)
m (formatting)
Line 3:
A pseudocode function to demonstrate recursion would look something like this:
 
'''function''' F '''with''' arguments
'''if''' ''end condition is not met''
'''return''' ''F called with new set of arguments''
'''else'''
'''return''' ''end condition value''
More than one end condition is allowed. More than one recursion condition is allowed.
 
Line 21:
 
Sometimes, tail-recursive functions are coded in a way that makes them not tail-recursive. The example above could become tail-recursive if it were transformed to look like this:
<pre> '''function''' F '''with''' arguments
'''if''' ''end condition is met''
'''return''' ''end condition value''
'''else'''
'''return''' ''F called with new set of arguments</pre>''
 
Below is a list of examples of recursion in computing.
Anonymous user