Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I thought "NlogN" is "N" times "logN", but why is it described as "double PLUS an amount proportional to N"

I'm currently learning about the big O notation. In the material, O(NlogN) was described as Doubled plus an amount proportional to N. But I thought that would be O(N + logN) and not O(NlogN) (I thought O(NlogN) is Double times logN).

Is there something logically wrong with my understanding?

enter image description here

like image 818
Thor Avatar asked Mar 05 '23 09:03

Thor


1 Answers

Replace N with 2N as stated:

2N log 2N = 2N * (log N + log 2) (using logarithm rules)

  • Doubled original term 2 * (N log N)

  • Additional term (2 log 2) * N i.e. "proportional to N".

like image 171
meowgoesthedog Avatar answered Mar 07 '23 23:03

meowgoesthedog



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!