Asymptotic Analysis
Asymptotic analysis is a mathematical approach to evaluate the performance of algorithms in terms of their resource usage (e.g. time or space) as the size of the input data () grows infinitely large. Instead of focusing on exact execution times, it provides a generalized way to express the efficiency of algorithms by describing their growth rates and behavior as input sizes increase using the following notations:
- -notation (big-oh notation) characterizes an upper bound on the asymptotic behavior of a function , such that it may not run faster than a certain rate. In other words, -notation is the set of all functions that run slower than (or equivalently slow to) . Formally, for a given function , -notation states that there exist positive constants such that
- -notation characterizes a lower bound on the asymptotic behavior of a function , such that it grows at least as fast as a certain rate. In other words, -notation is the set of all functions that run faster than (or equivalently fast to) . Formally, for a given function , -notation states that there exist positive constants such that
- -notation characterizes a tight bound on the asymptotic behavior of a function , such that it runs precisely at a certain rate. It is the set of all functions that run just as fast as . Formally, for a given function , -notation states that there exist positive constants such that
Moreover, for any two functions and , if and , then , meaning that is tightly bound by from both above and below.
Proper Abuse ) instead of the set membership sign () within formulae. There are two different ways of interpreting this notation:
Although we formally define asymptotic notation in terms of sets, we use the equal sign (
- When the asymptotic notation stands alone (e.g. ), the equals sign means set membership ().
- When the asymptotic notation appears in a formula (e.g. ), it stands for some function that has been abstracted ( where ).