Recursion
A self-referential data structure or computation.
Related concepts: TypeReferenceFunctionCall
Closest Wikipedia entry: Recursion (computer science) — In computer science, recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves from within their own code. The approach can be applied to many types of problems, and recursion is one of the central ideas of computer science.
Misconceptions about Recursion14 documented Misconceptions
Check YourselfBaseCaseNotNeeded — Java
Recursive computations do not necessarily need a base caseBaseCaseNotNeeded — Scratch
Recursive computations do not necessarily need a base caseBaseCaseSelfRecursive — Java
The base case of a structural recursion consists of a recursive self-callForEachTraversesRecursiveStructure — Java
For-each loops know how to traverse any recursive data structureRecursiveActivationsShareFrame — Java
Recursive calls of a method share a stack frameRecursiveCallSiteNoReturn — Java
Tail-recursive call sites have no continuationRecursiveFunctionNeedsIfElse — Python
A recursive function needs to contain an if-else statementRecursiveMethodImpliesRecursiveType — Java
A class with a recursive method represents part of a recursive data structureRecursiveMethodNeedsIfElse — Java
A recursive method needs to contain an if-else statementReferringToRecursiveStructureMakesRecursive — Java
A class referring to a recursive data structure is (indirectly) part of that recursion as wellReturnUnwindsMultipleFrames — Java
A return statement can unwind multiple call stack framesReturnUnwindsMultipleFrames — Python
A return statement can unwind multiple call stack framesUseOfSelfTypeImpliesRecursiveType — Java
If a class has a method that has a local variable, parameter, or return value with the class as its type, the class is a recursive typeVoidMethodNotRecursive — Java
A method with void return type can't be recursive