Concept Flow - Factorial Using Recursion
Call factorial(n)
Is n == 0 or 1?
Yes→Return 1
No
Return n * factorial(n-1)
Recursive call with n-1
Repeat until base case
Unwind stack, multiply results
Final factorial value returned
The function calls itself with smaller values until it reaches 0 or 1, then returns 1 and multiplies back up the call stack.
