Skip to content

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

UGC NET CS 2022 PYQ: Consider the following algorithms and their running times : Algorithms Complexities

Consider the following algorithms and their running times :

Algorithms Complexities
(A) Breadth First Search (I) $\theta(v+E)$
(B) Rabin-Karp Algorithm (II) $O(v+E)$
(C) Depth-First Search (III) $\theta((n-m-1) m)$
(D) Heap sort (worst case) (IV) $O\left(n^2\right)$
(E) Quick sort (worst case) (V) $O(n \lg n)$


Which one of the following is correct?

  1. A
    $\text{(A)-(III), (B)-(II), (C)-(I), (D)-(IV), (E)-(V)}$
  2. B
    $\text{(A)-(II), (B)-(III), (C)-(I), (D)-(IV), (E)-(V)}$
  3. C
    $\text{(A)-(II), (B)-(III), (C)-(I), (D)-(V), (E)-(IV)}$
    Correct answer
  4. D
    $\text{(A)-(III), (B)-(I), (C)-(II), (D)-(IV), (E)-(V)}$

Answer

(C) $\text{(A)-(II), (B)-(III), (C)-(I), (D)-(V), (E)-(IV)}$

Approach

Match each algorithm to its standard running time.

Reviewed by UGC IQ Editorial Team.