7

Most solutions to Exercise 4.4.6 of Intro. to Algorithms 3rd edition say, n*log3(n) = Big omega of (n*lg(n)).

Dose it mean log3(n) is equivalent to log2(n) when we are discussing time complexity of algorithms?

Thanks

chrk
  • 4,037
  • 2
  • 39
  • 47
user3674571
  • 81
  • 1
  • 3

1 Answers1

9

As far as big-Oh notation is concerned, the base of the logarithms doesn't make any real difference, because of this important property, called Change of Base.

According to this property, changing the base of the logarithm, in terms of big-oh notation, only affects the complexity by a constant factor.

So, yes. In terms of big-Oh notation, log3(n) is equivalent to log2(n).

chrk
  • 4,037
  • 2
  • 39
  • 47
  • how about log1.5(n)?. I am trying to solve recurrence of heapify function and I come to the conclusion on log3/2(n). I am not sure it's N or log(n) – Vikas Verma Jan 04 '20 at 09:45