i know this is no c++ question, can any one tel me:
in efficiency class is log2^n the same and log3^n or logx^n, because we can change base right?
thanks in advance .
Printable View
i know this is no c++ question, can any one tel me:
in efficiency class is log2^n the same and log3^n or logx^n, because we can change base right?
thanks in advance .
O_o
Are you talking about "BigO"?
If so, yes, because constant factors are abstracted away because they don't affect growth potential.
(Unless you are taking about trying to make a O(logN(N)) algorithm look like something it probably isn't.)
Soma
... and why it's not even usually spelled as O(logn^n), but simply O(log n)
log[a](N)=log[b](N)/log(a).
So if you have a bunch of functions that have a log term of any base, you can convert them to functions of a log term of your favorite base, with a constant product. Constant products are ignored in O(N) notation, so it doesn't matter what base is used; they are all comparable, as long as it is greater than 1.