I am given two functions: F1(n)=2n+20 and F2(n)=n+1. I have to show which one is better.
Our lecturer solved a similar problem. Given F1(n)=n2 and F2(n)=2n+20, he did:
F2(n)/F1(n)=(2/n)+(20/n2)
and he said it would be always less than 22, hence 2n+20 is better.
My doubt is how do I solve these types of comparison between functions. I have gone through all questions previously asked here and didn't quite understand it.
Also if given (an2+bn+c)=O(n2), please help in choosing constants c1, c2, n0 such that
c1g(n) ≤ f(n) ≤ c2g(n).