1

Can the complexity of an algorithm be at the time in O(n^2) and in O(n logn)? i am sure about this one. But what about in Ω(n^2) and in O(n logn), also and in Θ(n^2) and in Ω(n logn). Thanks

1
  • I think you are missing an important letter when you say and in (n logn)- did you mean to put an O, an , or a Θ there before the parentheses? Commented Dec 25, 2012 at 17:43

1 Answer 1

5
  1. Big-O notation refers only to the upper bound. Thus, if it is in O(n log n), it is necessarily in O(n^2) (since n^2 grows faster than n log n).

  2. No, it cannot be in both Ω(n^2) and in O(n log n). That would mean "upper bounded by n log n and lower bounded by n^2, which is impossible.

  3. Θ(n^2) means it is bounded both above and below by n^2, which necessarily means it is bounded below by Ω(n log n).

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, but what about in Ω(n^2) and in O(n logn) it seems correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.