0

In one place I'm reading the performance of a heapsort is

N log₂(N) 

and in another it says

N log N

Are they the same?

Alex R
  • 1

1 Answers1

0

Since $\log_2(N) = \frac{ \log{N}}{\log{2}}$ for all $N$, and $\log{2}$ is only a constant, they are the same in the sense that $N \log_2{N} = O(N \log{N})$, and vice versa.

SvanN
  • 2,307
  • Be aware that the other side of this is not true: $O(2^N)$, $O(e^N)$ and $O(10^N)$ do not mean the same things as each other – Henry May 17 '17 at 14:01