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).
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
- Recursion
- Red-black tree
- Reservoir sampling
- Segment tree
- Selection sort
- Separate chaining
- Shortest path
- Sliding window
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.