Recursion
A programming technique where functions call themselves to solve problems by breaking them into smaller versions of the same problem. Recursion requires a base case to terminate recursion and a recursive case that calls the function with modified parameters. Recursion naturally suits problems with recursive structure like tree traversal or factorial calculation. Understanding recursion is essential for advanced algorithms.
Real World
Google's search engine uses recursion to crawl the web — each page links to other pages, and the crawler recursively follows those links, with base cases preventing it from revisiting pages already indexed.
Exam Focus
Always identify and state the base case first; examiners award separate marks for base case and recursive case.
How well did you know this?