recursive subroutine

views updated

recursive subroutine A subroutine that calls itself. Such a self-referential call must occur as one branch of a conditional statement, otherwise there would be an infinite series of calls. As an example, a recursive subroutine to calculate factorial (n) would call itself to calculate factorial (n – 1), unless n = 1 when the value 1 will be returned.