Recursive functions need two cases
Base case
Recursive case
Base case
When to stop recursing
Recursive case
When to keep recursing
Push
Add a new item to the end
Pop
Remove an item from the end
Stack
A simple data with push and pop.
Like a stack of books. Last in first out.
What to do if a call stack is too big
Tail recursion
A recursive function where the recursive call is the last one executed. This can be optimized by the compiler in some languages to use less space on the call stack.