Big O Notation
Review an in-depth guide to Big O notation.
We'll cover the following
Standard notation of time complexity
We know how we can represent any algorithm through the order of or input. Big O notation is the most convenient way to express the worst-case scenario for an algorithm.
Consider a code where we use the sqrt(Range)
algorithm. The Big O notation is for this case. This algorithm couldn’t be worse than anything.
Consider another code where we have to iterate over one million times if is 1000003. The Big O notation is for this case, which is the worst-case scenario in this case.
Now, comparing these two worst-case scenarios, we can safely say that the algorithm of the former is better than the latter.
Get hands-on with 1400+ tech skills courses.