retagged by
1,286 views

2 Answers

Best answer
1 votes
1 votes

n= O(n^2) because n^2 always upper-bounds n, because n^2>=n for every +ve value of n you take

But O(n) is not equal to O(n^2) because that will mean O(n^2) =O(n) that is n upper-bounds n^2, but given any value of n>1, this can never be true as n^2>n for n>1.

Just replace n with n^2019 and n^2 with n^2020 for the above problem.

edited by
1 votes
1 votes
Strictly speaking the = sign is an abuse of notation. Actually it should be $n^{2019}$ $\in$ O($n^{2020}$), O($n^{2020}$) the set of functions bounded by $n^{2020}$

Related questions

2 votes
2 votes
0 answers
2
ashish pal asked Jan 22, 2018
675 views
Let f (n) = Ο(n), g(n) = Ω(n) and h(n) = θ(n). Then g(n) + f(n).h(n) is ______A.) Ω(n)B.) θ(n2)C.) Ω(n2)D.) θ(n)How to do these type of questions ?
0 votes
0 votes
0 answers
3
0 votes
0 votes
2 answers
4
Anusha Motamarri asked Dec 5, 2016
1,565 views
what if i take f(x) = sinx,g(x)= cosx?these two cant be compared.sinx cant be written as O(cosx) and also cosx cant be written as O(sinx)then B becomes invalid.plz verify...