Search code examples
algorithmbig-oasymptotic-complexity

Finding Worst Case complexity of the function 4n log n+7n


I am having a hard time trying to solve this one particular Big Oh problem:

4n log n+7n=O(n log n)

I have tried by applying n>=1, but nothing's coming out of it and the only hint is that 4n log n dominates 7n.


Solution

  • You can use the below approach:

    4n log n + 7n <= 4n log n + 7n log n ; for all n>=2
                  <= 11n log n
                  = O(n log n).
    

    Hence, you can say that n log n dominates in this function, and the worst complexity comes out to be O(n log n).