Online Computer Dictionary
Browse words
|
Based on
FOLDOC
Queried for: tail recursion
Definition:
When the last thing a function (or procedure) does is to call itself. Such a function is called tail recursive. A function may make several recursive calls but a call is only tail-recursive if the caller returns immediately after it. E.g.
f n = if n < 2 then 1 else f (f (n-2) + 1) In this example both calls to f are recursive but only the outer one is tail recursive.
Tail recursion is a useful property because it enables tail recursion optimisation.
If you aren't sick of them already, see recursion and tail recursion.
Browse through top 20 categories or see more ...
- programming (659)
- application (76)
- networking (823)
- language (1034)
- operating_system (420)
- mathematics (228)
- graphics (155)
- compiler (21)
- library (41)
- World-Wide_Web (133)
- cryptography (36)
- database (166)
- algorithm (132)
- logic (61)
- software (72)
- audio (27)
- virtual_reality (10)
- communications (329)
- file system (28)
- filename_extension (25)


