chevron_leftRecursion & Backtracking All topics

Recursion & the Call Stack

the call stack · grows downward

    stack empty — every call has returned

answers, on the way back up

    nothing has returned yet

factorial(5) means 5 × 4 × 3 × 2 × 1. Watch how the computer gets there — it is not the way you'd do it by hand.

step 01/11

Practice

spec · json ↗