In this video we discuss how recursion works, specifically in the context of computing factorials. We introduce a user-facing function that calls a recursive function to compute the result. The video explains how each recursive call adds an activation register to the call stack, which can lead to a stack overflow error if the limit is exceeded. We walk through an example of computing the factorial of 3 using recursion, illustrating how the call stack grows and shrinks as the function calls are made and returned. Finally, we highlight the importance of trusting the system and formulating problems correctly to ensure that recursive functions work as intended.
7:30 · 2022