Skip to content
Related Articles

Related Articles

Algorithms | Dynamic Programming | Question 7

Improve Article
Save Article
Like Article
  • Last Updated : 28 Jun, 2021

In the above question, which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W?
(A) X[1, W]
(B) X[n ,0]
(C) X[n, W]
(D) X[n -1, n]

Answer: (C)

Explanation: If we get the entry X[n, W] as true then there is a subset of {a1, a2, .. an} that has sum as W.


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!