Search code examples
big-otime-complexityasymptotic-complexity

Giving the Big O, Big Theta and Big Omega for a function


How can one give Big O, Big Theta or Big Omega for a function like

T(n) = n + 10*log n

Can someone please tell me how I can get the complexity for such a thing?


Solution

  • Drop all lower-order terms and constants and you get:

    Θ(T(n)) = Θ(n + 10*log(n)) = Θ(n)
    

    Since this is a tight bound (Θ) we also infer upper and lower bounds as O(n) and Ω(n).