AI engineering glossary · Data structures algorithms
What is base case?
Base case: The simplest input of a recursive function that is answered directly without a further self-call. Without one, or with a step that never reaches it, the calls never stop and the program runs out of stack space.
Base case: an example
In a function that sums a list, an empty list returns 0 immediately and ends the chain of calls.
Related terms
More Data structures algorithms terms
- Bellman-Ford algorithm
- Big-O notation
- Big-Omega notation
- Big-Theta notation
- Binary search
- Binary search tree
- Binary tree
- Bipartite graph
Where you learn it
Base case is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.