← All recursion topics
Euclid's GCD
ActiveReturned
call stack
last in, first out
pseudocode
gcd(a, b)if b == 0: return areturn gcd(b, a mod b)
Frame 1 / 13
Call gcd(48, 18)
start
4
a: 1–500, b: 1–500
call stack
last in, first out
pseudocode
gcd(a, b)if b == 0: return areturn gcd(b, a mod b)
Frame 1 / 13
start
a: 1–500, b: 1–500