What is an easy way for finding C and N when proving the Big-Oh of an Algorithm?

前端 未结 5 915
故里飘歌
故里飘歌 2020-12-24 09:14

I\'m starting to learn about Big-Oh notation.

What is an easy way for finding C and N0 for a given function?

Say, for example:

(n+1)5

5条回答
  •  一个人的身影
    2020-12-24 09:34

    It's going to depend greatly on the function you are considering. However, for a given class of functions, you may be able to come up with an algorithm.

    For instance, polynomials: if you set C to any value greater than the leading coefficient of the polynomial, then you can solve for N0.

提交回复
热议问题