Which grows faster 2n or n why n grows faster n nn 1n

This preview shows page 2 - 3 out of 3 pages.

5. Which grows faster, 2^n or n! ? Why?
10 pts (2 each) 6. Give the Big-O notation for the following expressions: a. 4n^5 + 3n^2 – 2; O(n^5) b. 5^n - n^2 + 19; O(5^n) c. (3/5)*n; O(n) d. 3n * log(n) + 11; O(nlogn) e. [n(n+1)/2 + n] / 2; O(n^2) Questions 7-12 are 10 points each. Assume numItems has the role of N, which may vary from one run to the next. Let numItems = n in questions 7-12; 7. What is the Big-O running time for this code? Explain your answer.
8. What is the Big-O running time for this code? Explain your answer.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture