记录一下计算复杂度理论中的一些记号。
-notation (also called Big notation), -notation (Omega notation), and -notation (Theta notation) are mathematical notations used in computer science and computational complexity theory to describe the behavior of functions and algorithms.
-notation
It provides an asymptotic upper bound on the growth rate of a function.
In simpler terms, it describes the maximum amount of resources (time or space) that an algorithm requires as a function of the input size, without being excessively pessimistic.
Formally,
Mathematically, this means that there exists a positive constant
-notation
Ω-notation represents the lower bound or best-case behavior of a function or algorithm.
It indicates the minimum amount of resources required.
Formally,
Mathematically, this means that there exists a positive constant
For example, if an algorithm has a time complexity of
-notation
It provides both the upper and lower bounds on the growth rate of a function, indicating that the function grows at the same rate as the bound.
Formally,
Mathematically, this means that there exist positive constants
For example, if an algorithm has a time complexity of Θ(n^2), it means that the running time of the algorithm grows quadratically with the input size, and the upper and lower bounds match.