Now, let’s formally learn the notations.
Asymptotic notations are notations used to describe the behaviors of the running time of an algorithm. There are three main notations, namely Big-O, Omega, and Theta.
Big-O notation, or O(running time), represents the upper bound. Omega notation, or Ω(running time), represents the lower bound. Theta notation, or Θ(running time), represents the average value or range.
nis the input size(like a list of n numbers). Also, suppose
cis some positive constant (like 1, 24, 4.5, 8, and so on). Then
O(n)means that the algorithm you are analyzing takes no more than
Ω(n)means that the algorithm you are analyzing takes at least
Θ(n)means that the algorithm is both
Ω(n), meaning it is exactly
As you can see here, the constants are ignored in asymptotic notations. We will get to why in the next section.