1

What do the following mean, in the context of greater than, or smaller than?

$$ O(n \log ⁡n) > O(n) $$

$$ O(nlogn) < O(n^2) $$

John Smith
  • 125
  • 5

1 Answers1

3

In this context, this comparison means the subset of. Hence, $O(n\log n) > O(n)$ means All members of $O(n)$ exist in $O(n \log n)$ as well or $O(n) \subset O(n \log n)$. For example, $f(n) = \sqrt{n} \in O(n)$ and $f(n) \in O(n\log n) $ and $g(n) = n \log n \not \in O(n)$ and $g(n) \ \in O(n \log n)$.

OmG
  • 3,572
  • 1
  • 14
  • 23
  • Can you elaborate? I've seen this before, but, wasn't so sure. Thanks. – John Smith Sep 17 '20 at 13:23
  • @JohnSmith Please see the new included example. – OmG Sep 17 '20 at 13:28
  • So, if, Algorithm1 is $$O(n)$$, and we modify it so, that it includes $$O(NlogN)$$, then we can exclude $$O(n)$$, and then the new algorithm is more dominant thus: $$O(n \log ⁡n) > O(n)$$ – John Smith Sep 17 '20 at 17:09
  • So, what does this statement mean: $$O(nlogn) < O(n^2)$$ ?? – John Smith Sep 17 '20 at 17:11
  • @JohnSmith You can interpret $O(n\log n) < O(n^2)$ such as the other case. For example, $n \sqrt{n} \in O(n^2)$, but it is not in $O(n\log n)$. – OmG Sep 17 '20 at 17:45