Sunday, 18 August 2013

Big Oh with log (n) and exponents

Big Oh with log (n) and exponents

So I have a few given functions and need to fond Big Oh for them (which I
did).
n log(n) = O(n log(n))
n^2 = O(n^2)
n log(n^2) = O(n log(n))
n log(n)^2 = O(n^3)
n = O(n)
log is the natural logarithm.
I am pretty sure that 1,2,5 are correct. For 3 I found a solution
somewhere here: n log(n^2) = 2 n log (n) => O (n log n) But I am
completely unsure about 4). n^3 is definitely bigger than n*log(n^2) but
is it the Oh of it? My other guess would be O(n^2).
A few other things:
n^2 * log(n)
n^2 * log(n)^2 What would that be?
Would be great if someone could explain it if it is wrong. Thank you!

No comments:

Post a Comment