复杂度
字数: 0
Algorithms complexity / Growth of Functions

渐进记号

Asymptotic Notation
A way to describe the rate with which the running time of the algorithm increases compared to the rate at which the size of the problem () increases.
notion image

o-notation

  • 的增长率小于
    • 明确(准确计算)知道小于它
  • For example, , but

O-notation

notion image
when we have only an asymptotic upper bound
💡 Always concerned with worst case(max) time requirement
 
的增长率小于等于
  • 不确定是否等于时使用(近似复杂度)

Θ-notation

notion image
For all , the function is equal to to within a constant factor.
We say that is an asymptotically (渐近地) tight bound for .
 
的增长率与 相同
  • 即代表准确的复杂度

Example

  • Show that
    • To do so, we must determine positive constants such that
      Dividing by yields
      Thus, by choosing , we can verify that

Ω-notation

notion image
 
when we have only an asymptotic lower bound
 
的增长率大于等于
 

ω-notation

  • 的增长率大于
 
2023 - 2026