← Back

Recursion Introduction

Function calling itself with base case to reduce problem.

recursionbasicsUpdated 2025-09-01

Essentials

  • Base case stops infinite calls
  • Progress: each call simplifies state

Example

  • int fact(int n){ return n<=1?1:n*fact(n-1); }