1. ## Finding Big Oh

I'm trying to calculate the big oh for something

f(N) = .00001 * N^2 + .01*N + 1
g(N) = 4*log2(N)

What's the Big Oh for f and g?

What values of N are best for f(N) and g(N)

What does this tell you about using Big OH to decided which algorithm to use?

----------

I haven't done a whole lot with big Oh, but this is a sample problem from an old test i'm practicing off. Any help would be great.

Thanks

2. $O(f) = N^2$
O(g) = log N

The largest power of N in a polynomial is always its big Oh notation

Any function containing just a logarithm has O(log N).

To find which algorithm is best for which values of N, the simplest way is probably just to solve f(N) = g(N) and then test a number in each interval between the solutions to find out which is better in that interval.

What does this tell you about using Big OH to decided which algorithm to use?
They probably want you to say that it is only useful for large values of N.

3. thanks.

so, for example, f(N) N^5 + N^2 + 7log(N) will still have a big Oh of N^5? Or does the log negate something

4. Originally Posted by Eclyps19
thanks.

so, for example, f(N) N^5 + N^2 + 7log(N) will still have a big Oh of N^5? Or does the log negate something
log(N) grows more slowly than any positive power of N, so N^5 + N^2 + 7log(N) is O(N^5)

RonL