Lecture Outline
- Recursion is a problem solving technique that involves a method calling itself
- When using recursion, we solve a bigger problem by solving smaller problems and building up a solution from the solution of the smaller problems
- Every recursive method needs a base case and a recursive case
- Recusion can struggle as our input size gets very large. If we recurse too much, we can get a stack overflow error
- When analyzing the runtime of a recursive algorithm, we must look at how many recursive calls are made, and the running time of each recursive call
Lecture Recording
Lecture Slides
Code