CARVIEW |
Select Language
HTTP/2 200
content-type: text/html; charset=utf-8
date: Mon, 25 Aug 2025 11:02:59 GMT
permissions-policy: interest-cohort=()
strict-transport-security: max-age=31536000; includeSubDomains
server: nginx
cache-control: s-maxage=61397, max-age=0
x-powered-by: Next.js
etag: "104zdwxpvti9a0c"
content-encoding: gzip
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; frame-ancestors 'self';
vary: Accept-Encoding
x-cache: Miss from cloudfront
via: 1.1 72061b8b5eb2f7797212cde59925f584.cloudfront.net (CloudFront)
x-amz-cf-pop: BOM78-P9
x-amz-cf-id: wEeOQfNFwEBPFNJCQ8PJO6tntUcxzTvEuJB86dy0oYn8U7ZCFNIvRg==
GATE | CS | 2008 | Algorithm | Dynamic Programming | Question 81
Interview Preparation
- Interview Preparation For Software Developers
- Must Coding Questions - Company-wise
- Must Do Coding Questions - Topic-wise
- Company-wise Practice Problems
- Company Preparation
- Competitive Programming
- Software Design-Patterns
- Company-wise Interview Experience
- Experienced - Interview Experiences
- Internship - Interview Experiences
GATE | CS | 2008 | Algorithm | Dynamic Programming | Question 81
Last Updated :
Discuss
Comments
The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 ,a2 ,a3 ,...,an} 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 {a1 ,a2 ,...,ai} whose elements sum to j. Which of the following is valid for 2 <= i <= n and ai <= j <= W? Which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W?
X[1, W]
X[n, 0]
X[n, W]
X[n-1, n]
This question is part of this quiz :
GATE CS 2008,Algorithms GATE CS PYQ Quiz,Dynamic Programming GATE CS PYQ QuizShare your thoughts in the comments

GeeksforGeeks
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy