Question #254901

a particular algorithm increases in time as the number of operations n increases.

Suppose the time complexity of this algorithm is given by:

f(n)=4n2+5n2*log(n)

Show that f(n) is O(g(n)) for g(n) = n3

1
Expert's answer
2021-11-30T13:26:50-0500

f(n)=4n2+5n2log(n)f(n)=4n^2+5n^2*log(n) , g(n)=n3g(n) = n^3

Now to show f(n)=O(g(n))f(n)=O(g(n)) when number of operation increases i.e., nn\rightarrow \infty then

f(n)g(n)=4n3+5n2.log nn3=4+5.log nn\frac{f(n)}{g(n)}=\frac{4n^3+5n^2.log\ n}{n^3}=4+\frac{5.log\ n}{n}

Now, limn\lim_{n\to\infty} f(n)g(n)=4+limn5.log nn\frac{f(n)}{g(n)}=4+\lim_{n\to\infty}\frac{5.log\ n}{n}

=4+5limn1/n1=4+5\lim_{n\to\infty} \frac{1/n}{1} [Using L'Hospital Rule]

=4+5×0=4=4+5\times0=4

So, f(n)g(n)4|\frac{f(n)}{g(n)}|\rightarrow 4 as nn\rightarrow\infty

So, f(n)=O(g(n))f(n)=O(g(n))


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS