Loading
-
1.
Statement for linked Answer Questions ::
The subset –sum problem is defined as follows. Given a set of n positive integers, S = {a1, a2, a3, ......, an} and a positive integer W, is there a subset of S whose elements sum of W? A dynamic program for solving this problem uses a 2-dimensional Boolean array, X, with W+1 rows and n columns X[i, j], 1 ≤ i ≤ n, 0 ≤ j ≤ W, is TRUE if and only if there is a subset of {a1, a2, …., ai} whose elements sums to j.
[1] Which of the following is valid for 2 ≤ i ≤ n and ai ≤ j ≤ W? [2 marks]
(A) X[i, j] = X[i – 1, j] ∨ X[i, j – a1]
(B) X[i, j] = X[i – 1, j] ∨ X[i – 1, j – a1]
(C) X[i, j] = X[i – 1, j] Λ X[i, j – a1]
(D) X[i, j] = X[i – 1, j] Λ X[i – 1, j – a1][2] Which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W? [2 marks]
(A) X[ 1, W]
(B) X[ n, 0]
(C) X[ n, W]
(D) X[n – 1, n]asked in Mechanical Engineering, 2008
View Comments [0 Reply]
-
2.
-
3.
A company is offered the following price breaks for order quantity
Order quantity Price (Rs.) 0-100 150 101 and above 100
[5 marks]
asked in Mechanical Engineering, 2001
View Comments [0 Reply]
-
4.
-
5.
-
6.