Level 2
1 day < 1 min
LeaderboardGuest · Log in
Key point 6 of 8 · Data Structures and Algorithms
Estimated reading time: 4 min

Algorithm Design Strategies

Recursion is a technique in which a function solves a problem by calling itself on smaller instances of that same problem, relying on a base case that terminates the recursion and a recursive case that reduces the problem toward that base case. Each recursive call adds a new frame to the program's call stack, which means excessively deep recursion risks a stack overflow, though some languages and compilers can optimize a specific pattern called tail recursion to avoid this. Recursion is the natural way to express problems with a self-similar structure, and it forms the conceptual foundation for divide-and-conquer algorithms, for traversing trees and graphs, and for backtracking search.

Food for thought

Why do you think there's historiographical debate about "Algorithm Design Strategies"?