Skip to content

UGC NET CS 2020Data Structures and Algorithms › Performance Analysis of Algorithms and RecurrencesVerified

UGC NET CS 2020 PYQ: The running time of an algorithm is $O(g(n))$ if and only if

The running time of an algorithm is $O(g(n))$ if and only if

  1. A
    its worst-case running time is $O(g(n))$ and its best-case running time is $\Omega(g(n)) \cdot (O= \textit{ big }O)$
    Correct answer
  2. B
    its worst-case running time is $\Omega (g(n))$ and its best-case running time is $O(g(n)) \cdot (O= \textit{ big }O)$
  3. C
    $O(g(n))= \Omega(g(n))(O=\textit{big } O)$
  4. D
    $O(g(n))\cap \omega(g(n))$ is non-empty set, $(o = \textit{ small } o)$

Answer

(A) its worst-case running time is $O(g(n))$ and its best-case running time is $\Omega(g(n)) \cdot (O= \textit{ big }O)$

Approach

Combine an upper bound on the worst case and a lower bound on the best case to bound all running times.

Reviewed by UGC IQ Editorial Team.