AI engineering glossary · Data structures algorithms

What is recurrence relation?

Recurrence relation: An equation that defines the running time of a recursive algorithm in terms of its running time on smaller inputs, such as T(n) = 2T(n/2) + n. Solving it gives a closed-form bound like O(n log n).

Level: advancedTopic: Data structures algorithms

Recurrence relation: an example

Merge sort splits into two halves and merges in linear time, so T(n) = 2T(n/2) + n, which solves to O(n log n).

Related terms

More Data structures algorithms terms

Where you learn it

Recurrence relation 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.