Reputation: 521
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
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