Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M1517

Recursion

Recursion
StructureHigh supportLogic
Included
account_tree

Updated 2026-07-28

Loading revision record…

Summary

Recursion, also translated as recursion, in mathematics and computer science, refers to a method where the definition of a function uses the function itself. The term recursion is also commonly used to describe the process of repeating things in a self-similar manner. For example, when two mirrors are approximately parallel to each other, the nested images in the mirrors appear as infinite recursion. It can also be understood as a process of self-replication.

Definition

Recursion, also translated as recursion, in mathematics and computer science, refers to a method where the definition of a function uses the function itself. The term recursion is also commonly used to describe the process of repeating things in a self-similar manner. For example, when two mirrors are approximately parallel to each other, the nested images in the mirrors appear as infinite recursion. It can also be understood as a process of self-replication.

How to use

Recursion, also translated as recursion, in mathematics and computer science, refers to a method where the definition of a function uses the function itself. The term recursion is also commonly used to describe the process of repeating things in a self-similar manner. For example, when two mirrors are approximately parallel to each other, the nested images in the mirrors appear as infinite recursion. It can also be understood as a process of self-replication.

Mechanism

A function or procedure calls itself, reducing the problem to smaller subproblems of the same type until reaching a base case.

Practice

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Factorial calculation, tree traversal.

Common pitfalls

  • Lack of a base case leads to infinite recursion.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E9%80%92%E5%BD%92ZH · Explicit
    verified
account_treeGenealogyexpand_more