Index Ai Academy
Glossary · Phase 7 · Software engineering

Recursion

Also written: recursive

A function solving a problem by calling itself on a smaller version of it, until it reaches a case simple enough to answer directly.

Try it now

Three frames for sum_to stack up before any of them can return. Then each one finishes, adding its n to the answer from below.

Learn it properly

Recursion, trees and graphs · Functions that call themselves, and the shapes most real data takes. About 35 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write