Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Algorithms | Dynamic Programming | Question 7

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads