Skip to content

UGC NET CS 2019Data Structures and Algorithms › Design TechniquesVerified

UGC NET CS 2019 PYQ: Consider the following steps: $S_1$: Characterize the structure of an optimal solution $S_2$: Compute the…

Consider the following steps:

$S_1$: Characterize the structure of an optimal solution

$S_2$: Compute the value of an optimal solution in bottom-up fashion

Which of the following step(s) is/are common to both dynamic programming and greedy algorithms?

  1. A
    Only $S_1$
    Correct answer
  2. B
    Only $S_2$
  3. C
    Both $S_1$ and $S_2$
  4. D
    Neither $S_1$ nor $S_2$

Answer

(A) Only $S_1$

Approach

Compare the steps of dynamic programming and greedy design.

Reviewed by UGC IQ Editorial Team.