So, clearly, log(n) is O(n). But, what about (log(n))^2? What about sqrt(n) or log(n)--what bounds what?
There's a family of comparisons like this:
n^a versus (log(n))^b
I run into these comparisons a lot, and I've never come up with a good way to solve them. Hints for tactics for solving the general case?
Thanks,
Ian
EDIT:
I'm not talking about the computational complexity of calculating the values of these functions. I'm talking about the functions themselves. E.g., f(n)=n is an upper bound on g(n)=log(n) because f(n)<=c*g(n) for c=1 and n0 > 0.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…