Tail recursion

/teɪl rɪˈkɜrʒən/ noun phrase

Definition

A form of recursion where the recursive call is the last operation performed in the function, allowing compilers to optimize it into a loop to prevent stack overflow. The function returns the result of the recursive call directly without further computation.

Etymology

The term 'tail' refers to the position at the end of the function, combined with 'recursion' from Latin 'recursus' meaning running back. This optimization technique was identified in early functional programming language research in the 1960s.

Kelly Says

Tail recursion is like climbing down a spiral staircase where each step replaces the previous one instead of stacking on top - you never run out of staircase! This clever trick lets you write recursive functions that won't crash your program even with millions of iterations.

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.