Can O(n + logn) be called O(n)?

45 Views Asked by At

I know that O(n + 5) would be classified as a worst-case runtime of O(n), but can I do that with logn too?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, $O(n+\log n)$ and $O(n)$ are the same complexity class, because $n+\log n\in O(n)$ and $n\in O(n+\log n)$.