Developer concepts

What is Big O notation?

How the work an algorithm does grows as its input grows.

Two pieces of code can give the same answer, and one is still a thousand times slower once the data gets big. Big O is how developers talk about that.

What it is

Big O notation describes how the work an algorithm does grows as its input grows.

How it works

O(1) means constant: the same time no matter how much data, like grabbing an item by its position. O(n) means the work grows with the data, like checking every item in a list. O(n²) means comparing every item with every other item, and that gets slow fast. Ten times the data, a hundred times the work.

Why it matters

It helps you spot the code that will fall over at scale, before your users find it for you.

More from The Benmore Brief on YouTube

Put AI to work in your business.

Benmore's forward deployed engineers build and connect the software, from discovery to deployment.

Talk to us