@Nandhakumar
If a question asks about the time complexity of an algorithm without specifying whether it's the best, worst, or average case, it means they want to know the complexity in all scenarios.
For example, if the best case is $ \theta(n) $ and the worst case is $ \theta(n^2) $, you can say that the algorithm's time complexity is $ O(n^2) $ or $ O(n^3) $ or even $ O(n^4) $. However, if they insist on the tightest bound, then the answer would be $ O(n^2) $.
Summary:
Question (MSQ):
What is the tightest bound time complexity of an algorithm that has a best-case time complexity $ \theta(n) $ and a worst-case time complexity $ \theta(n^2) $? (Please try to solve it without looking at the answers)
A. $ \Omega(n) $
B. $ \Omega(n^2) $
C. $ O(n^2) $
D. $ O(n^3) $
The correct answers are A and C.
($ \Omega(n) $ is tighest lower bound and $ O(n^2) $ is tighest upper bound).