✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The subset-sum problem is defined as follows.
Given a set of n positive integers, S = and positive integer W, is there a subset of S whose elements sum to W?
A dynamic program for solving this problem uses a 2-dimensional Boolean array X, with n rows and W+1 columns.
X[i, j],1 i n, 0 j W, is TRUE if and only if there is a subset of whose elements sum to j.
Which of the following is valid for 2 i n and ai j W?