MicrolearnENPTES

Big-O: how work grows

Lesson 2 of 20 · Algo.Micro

Compare algorithms by how their cost grows with the input size, not by seconds on one computer.

Seconds depend on the machine; steps do not

A fast laptop and an old phone give different times for the same code. Counting basic operations (comparisons, looks, swaps) as a function of the input size n gives an answer that holds everywhere.

Check yourself

If n doubles, what happens to the work of an O(n²) algorithm?

Do it in the browser: a real algorithms tool, a short mission and instant feedback. No install.

Start this lesson — free
← Searching one by oneBinary search →

All lessons · Algo.Micro