Nepedia
Back to Discover
Developing Reader
💻

Recursion (computer science)

technology Maturity 7-9 Next article →

A computer can solve big jobs. It breaks them into small jobs. It does this by doing the same thing again.

recursiveTree
recursiveTree

This is called recursion. It happens when a task calls itself. The task gets smaller each time. This helps the computer finish the work.

Sierpinski triangle turtle
Sierpinski triangle turtle

Every task needs a stop rule. This rule is the base case. It tells the computer when to stop. Without it, the computer never stops.

Some tasks use one rule. Other tasks use many rules. This can make the work harder.

Tower of Hanoi
Tower of Hanoi

Recursion helps us see patterns. You can see it in math. You can see it in art too.

104 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (5)
File:recursiveTree.JPG
recursiveTree.JPG
File:Sierpinski triangle turtle.gif
Sierpinski triangle turtle.gif
File:Recursive1.svg
Recursive1.svg
File:Recursive2.svg
Recursive2.svg
File:Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.