WordGarden.io

recursion

C2
Uncommon

Pronunciation

UK

    US

      Meanings

      Noun

      1. the technique of defining a function, process, or structure in terms of itself

      2. the nesting of grammatical structures inside similar structures

      Beyond the definition

      Recursion is like those Russian nesting dolls: each doll contains a smaller version of itself. In programming and mathematics, it means defining something in terms of itself. Think of a set of instructions that use the same steps again to solve a problem, breaking it into smaller, similar parts until an answer is reached. It is a useful way to handle complex tasks by repeating a process with changed inputs. You might also meet this idea in art or literature, such as a story within a story or a picture that includes itself.

      Examples

      1. 1

        Programming example

        The lesson starts with a simple function that uses recursion to search a folder of files.

      2. 2

        Learning difficulty

        Many beginners find recursion confusing until they see where the process stops.

      3. 3

        Base case

        Without a clear base case, recursion can keep going until the program crashes.

        • Domainbase case

          the condition that stops the repeated process

      4. 4

        Programmer joke

        "To understand recursion, you must first understand recursion" is a common joke among programmers.

        • Note

          This joke repeats the word on purpose to imitate recursion.

      See also

      Similar

      • self-reference

      Shades of meaning

      • recurrence relation
      • infinite regress

      Contrast

      Used with (collocations)

      • recursive function
      • recursive definition
      • tail recursion

      Word family

      Explore

      • base case
      • call stack

      Forms and spellings

      2 forms open this card.

      Main spelling

      • recursionnoun

      Forms

      • recursionspluralnoun