Chapter 3: Recursion
every recursive function has two parts:
base case
recursive case
ex:
The call stack
Recap
Recursion is when a function calls itself.
Every recursive function has two cases: the base case and the recursive case.
A stack has two operations: push and pop.
All function calls go onto the call stack.
The call stack can get very large, which takes up a lot of memory.
Stack
Push(Add a new item to the top)
Pop(remove the topmost item and read it)
Last updated
Was this helpful?