I have the following function to prove that its time complexity is less or equal to O(xlogx)
f(x) =xlogx+3logx2
I need some help to solve this.
I have the following function to prove that its time complexity is less or equal to O(xlogx)
f(x) =xlogx+3logx2
I need some help to solve this.
Given,
f(x) = xlogx+3logx^2
= xlogx+6logx // since log (a^b) = b log a
As we know, f(x) = O(g(x)), if | f(x) | <= M. | g(x) |, where M is a positive real number.
Therefore, for M>=7 and x varying in the real positive range,
M . x log x >= x log x + 6 log x
>= (x+6) log x.
f(x) = x log x + 3log x^2
= O(x log x).