What is the big O of the following formulae respectively: 1 ) (n+7)(n-2) 2) 100n
ID: 3750638 • Letter: W
Question
What is the big O of the following formulae respectively:
1 ) (n+7)(n-2)
2) 100n+5
3) n log n + n!
4) 2+ 4 + 6 + 8 + ...+ 2n where n is a positive integer
5) 1+ 3 + 5 + 7 + 9
a. Quadratic,Linear, Factorial, Quadratic,Constant
b. Factorial, Quadratic, Constant, Linear, Quadratic
c. Quadratic, linear, Constant, Quadratic, Linear
d. Quadratic, linear, Constant,Factorial, Quadratic
explain your answer
Explanation / Answer
1) (n+7)(n-2) => O(n^2) (so, it is Quadratic) 2) 100n+5 => O(n) (so, it is Linear) 3) n log n + n! => O(n!) (so, it is Factorial) 4) 2+ 4 + 6 + 8 + ...+ 2n where n is a positive integer => O(n^2) (so, it is Quadratic) 5) 1+ 3 + 5 + 7 + 9 => 25 = O(1) (so, it is Constant) So, answer is a. Quadratic,Linear, Factorial, Quadratic,Constant
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.