+ 3

Big O notation question

What is the upper bound for the function f(n)=2nĀ³-2nĀ².

10th Jan 2021, 7:13 AM
Achintya Raj
Achintya Raj - avatar
6 Answers
+ 6
2nĀ³ - 2nĀ² <= 2nĀ³ , for all n >= 1 O(f(n)) = O(2nĀ³) = O(nĀ³) Am I missing anything else?
10th Jan 2021, 7:26 AM
Minho
Minho - avatar
+ 4
It has cubic time/space complexity. Not sure if that was the question.
11th Jan 2021, 12:20 AM
Sonic
Sonic - avatar
+ 1
As the condition is 0<=f(n)<=g(n)
10th Jan 2021, 7:13 AM
Achintya Raj
Achintya Raj - avatar
+ 1
Yes you are correct for all n>=1 and c=2
10th Jan 2021, 8:03 AM
Achintya Raj
Achintya Raj - avatar
0
Yes I know the answer but someone was contradicting this so I just want to confirm this
10th Jan 2021, 9:01 AM
Achintya Raj
Achintya Raj - avatar
0
Thank you very much
10th Jan 2021, 9:01 AM
Achintya Raj
Achintya Raj - avatar