Big-O Notation
Learn about the meaning expressed by the big-O notation.
Given any two functions and , when we say a function is , we are expressing a certain relationship between the two functions.
Let’s look at the definition, but don’t worry if you don’t grasp it immediately. We’ll expand on its meaning and usage bit by bit.
Definition
We say is if for some positive constants and ,
There are two inequalities above. Let’s take the one on the right first and see what it means.
The inequality on the right
First, let’s focus on the following part of the definition
for some positive constants and .
On the right-hand side of the inequality, the constant is multiplied by . Multiplication of a function by a constant is known as scaling. Scaling has the effect of changing the shape of that function.
Try choosing different values for the constant to see how the example function scales.
Get hands-on with 1400+ tech skills courses.