lmngn23
lmngn23

Reputation: 521

Shorten a big O notation

I am working for a project of my class and would like some check/help to see if my shortening of Big O notation is right:

n*O(log(n)) + n * O(log((n)) = 2n*O(log(n)) = n*O(log(n))
n*O(1) + n * O(n) = n*O(n)

Is my shortening correct? and are these can be further shortened?

I would really appreciate any help.

Upvotes: 1

Views: 87

Answers (1)

Paul92
Paul92

Reputation: 9062

Since n is O(n), the first one is O(nlogn) and the second one is O(n^2).

The proof for n being O(n) can be done using the definition of O(n).

Upvotes: 3

Related Questions