Preface
When learning computer algorithms, I know that the time complexity of insertion sorting is O (n2). What does OSN mean? This article describes the tags used in algorithm analysis.
Odo
Definition: O (g (n) = {f (n ):Normal countC and n0, so that all n> = n0 has 0 <= f (n) <= cg (n )}. The Odo number indicates the progressive upper bound of the function.
Can be expressed as f (n) = O (n2 ). Proof:
To make 0 <= f (n) <= cg (n)
The existence of c = 9/2, n0 = 1, so that all n> = n0 has 0 <= f (n) <= cg (n ).
O (g (n) and the mark mentioned later represent a set, while f (n) = O (n2) actually means f (n) ε O (n2 ).
Assume that,
Then g (n) = O (n2), f (n) = O (n2)
Large Ω mark
Definition: Ω (g (n) = {f (n ):Normal countC and n0, so that all n> = n0 has 0 <= cg (n) <= f (n )}. The greater Ω mark indicates the progressive lower bound of the function.
Assume that,
Then g (n) = Ω (n), f (n) = Ω (n)
Mark
Definition: Random (g (n) = {f (n ):Normal countC1, c2, and n0 enable 0 <= c1g (n) <= f (n) <= c2g (n)} For all n> = n0 )}. The greater limit mark indicates the progressive confirmation of the function.
Assume that,
Then g (n) = random (n), f (n) = random (n2)
OSS note
Definition: o (g (n) = {f (n): pairArbitrary normal countC. If n0 exists, 0 <= f (n) <= cg (n)} exists for all n> = n0 )}. The Odo number indicates the upper bound of the non-progressive closeness of the function.
Assume that,
Then g (n) = o (n2), f (n) O (n2)
Small mark
Definition: (g (n) = {f (n): pairArbitrary normal countC. If n0 exists, 0 <= cg (n) <= f (n)} exists for all n> = n0 )}. The lower Mark gives the lower bound of the non-progressive closeness of the function.
Assume that,
Then g (n), f (n) = (n)
Summary
Not all functions can be incrementally compared. If the limit value does not exist (not equal to 0, constants, and infinity ). For example
The limit does not exist and is not equal to infinity.