What is the difference between Θ(n) and O(n)?

后端 未结 9 1165

Sometimes I see Θ(n) with the strange Θ symbol with something in the middle of it, and sometimes just O(n). Is it just laziness of typing because nobody knows how to type th

9条回答
  •  一整个雨季
    2020-11-22 05:01

    f(n) belongs to O(n) if exists positive k as f(n)<=k*n

    f(n) belongs to Θ(n) if exists positive k1, k2 as k1*n<=f(n)<=k2*n

    Wikipedia article on Big O Notation

提交回复
热议问题