AI engineering glossary · Data structures algorithms

What is time complexity?

Time complexity: A function describing how the number of basic steps an algorithm performs grows as the input size grows. It is usually written with Big-O and lets you predict whether a solution will still work when the data gets 1,000 times larger.

Level: beginnerTopic: Data structures algorithms

Time complexity: an example

A linear scan over 1 lakh orders is O(n), about 100,000 steps. A nested loop over the same data is O(n^2), about 10 billion steps and far too slow.

Related terms

More Data structures algorithms terms

Where you learn it

Time complexity 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.