The GATE Grind

GATE 2008 CS – Question 81

Algorithms · Dynamic Programming · 2 marks · Multiple choice

Given positive integers $S=\{a_1,\ldots,a_n\}$ and positive W, subset sum asks whether some subset sums to W. Boolean X[i, j], with n rows and W+1 columns (1≤i≤n, 0≤j≤W), is true iff a subset of the first i elements sums to j. Which entry being TRUE implies a subset sums to W?

  1. X[1, W]
  2. X[n, 0]
  3. X[n, W]
  4. X[n−1, n]

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) X[1, W]; (C) X[n, W]

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Dynamic Programming questions

All Dynamic Programming questions →