asymptotic tight bound for quadratic functions

后端 未结 6 774
-上瘾入骨i
-上瘾入骨i 2021-01-31 11:41

In CLRS (Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein), for a function

f(n) = an2 + bn

6条回答
  •  误落风尘
    2021-01-31 12:31

    P(n) = an2 + bn + c = an2( 1 + b / ( an ) + c / ( an2 )) = an2( 1 ± ( | b | / a ) / n ± ( √( | c | / a ) / n )2
    so if we take for example q = max( | b | / a, √( | c | / a )) than
    P(n) ≤ an2( 1 + ( q / n ) + ( q / n )2 ) and if we take n0 = q than we'll get the second constant
    c2 = 3a analogically for the lower bound

提交回复
热议问题