logo codesdope

Big O notation

   avi120697@gmail.com

I didn't understand the example given below especially the bolded part

n2+n=O(n2)n2+n=O(n2)

We have to show that cn2cn2 is the upper bound of n2+nn2+n for some positive constant cc.
Now, n≤n^2 for all n≥1
or, n^2+n≤n^2+n^2=2n^2n for all n≥1
Thus, c=2 and no=1(n^2+n≤2n^2=>n≥1) satisfy the condition.


Answers

Write your answer
Close

Welcome.please sign up.

Close

Welcome.please login.