-1

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.

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
Zeeshan shaikh
  • 341
  • 1
  • 5
  • 24

1 Answers1

3

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).
Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73