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.

Level: beginnerTopic: Data structures algorithms

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.