Answer to Question #327860 in Algorithms for Nath

Question #327860

Determine the complexity of the expression



(I) 5n² + 3nlogn + 2n + 5 that log n <= n for n >= 1



(II) 5n⁴ + 3n³ + 2n² + 4n + 1

1
Expert's answer
2022-04-12T13:26:01-0400

(I) As log n <= n, for n>=1, therefor nlog n <= n2, as far as n <= n2 and 1 <= n2 for n>=1.

So 5n² + 3nlogn + 2n + 5 <= 5n2 + 3n2 + 2n2 + 5n2 = 15n2 for n>=1.

Finally: complexity is O(n2)


(II) 1 <= n <= n2 <= n3 <= n4 for n >= 1. So 5n⁴ + 3n³ + 2n² + 4n + 1 <= 5n4 + 3n4 + 2n4 + 4n4 + n4 = 15n4 for n >= 1

Finally: complexity is O(n4)


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!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS