Every recursive function is built from two parts. The base case is the condition under which the function stops calling itself and simply returns a value; the recursive case is the branch in which the function calls itself on a smaller or simpler version of the original problem. Think of the recursive case as the engine that drives the computation forward and the base case as the brake that stops it at the right moment.
Both parts are required, and they must work together. A function with no reachable base case never stops, and each unfinished call keeps a stack frame alive until the runtime runs out of space and throws a stack overflow error. Just as dangerous is a recursive case that does not actually converge — for example, calling the function again on the same input, or shrinking the input in a way that skips past the stopping condition. In this course you will see this pattern repeatedly in factorial, Fibonacci, list and tree traversal, and divide-and-conquer algorithms, so recognizing the two components quickly is a skill worth building now.
As you watch the videos below, do three things. First, pause at each code example and point to the exact line that is the base case and the exact line that is the recursive case. Second, ask how the argument changes on each call and convince yourself it must eventually reach the base case. Third, notice how the speakers describe what happens on the call stack, since that is how an unterminated recursion turns into a crash rather than an infinite loop.
A concise introduction to recursion from WilliamFiset that, according to its description, walks through the components that make up a recursive function, including the base case and the recursive call. Expect clear definitions and simple worked examples showing how a function reduces a problem toward its stopping condition.
It targets exactly the two-part structure this topic is about, and WilliamFiset is a well-regarded source for algorithms and data structures content, making it a good, short first watch before the longer examples.
A beginner-friendly explanation of recursion using code examples, framed around the divide-and-conquer idea of breaking a problem into smaller pieces. The description also notes a comparison of speed, so expect some discussion of how recursive solutions stack up against iterative ones.
The step-by-step code walkthroughs make the base case and the shrinking argument of the recursive case easy to see, and the recursion-versus-iteration comparison connects this topic to later decisions about when recursion is the right tool.
Geekific's take on recursion, framed around why recursion breaks code — which points directly at what goes wrong when the base case is missing or the recursive case fails to converge. The tags indicate coverage of tail recursion alongside general recursion in a Java and data-structures context.
It is the best fit for the infinite recursion and stack overflow subtopics, since it approaches recursion from the failure side, and the tail recursion material previews strategies for reducing stack depth.
Together these videos build directly toward the module outcomes. All three define and locate the base case and the recursive case in working code, which supports MO1, and the Geekific video's focus on why recursion breaks reinforces the link between a missing or non-converging base case and stack overflow (MO1, MO5). The coded examples in the WilliamFiset and Python Simplified videos give you patterns you can translate into JavaScript implementations of factorial, Fibonacci, and list traversal (MO2) and give you something concrete to trace call by call (MO3). The recursion-versus-iteration comparison in the Python Simplified video, together with the tail recursion discussion in the Geekific video, supports evaluating when recursion is the better choice and how to reduce its costs (MO4, MO5).
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.