wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

The subset-sum problem is defined as follows:

Given a set S of n positive integers and a positive integer W; determine whether there is a subset of S whose elements sum to W.

An algorithm Q solves this problem in O(nW) time. Which of the following statements is false?

A
Q solves the subset-sum problem in Polynomial time when the input is encoded in unary
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
The subset sum problem belongs to the class NP
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Q solves the subset-sum problem is Polynominal time when the input is encoded in binary
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
The subset sum problem is NP-hard
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C Q solves the subset-sum problem is Polynominal time when the input is encoded in binary
If an algorithm Q solves subset-sum problem in O(nW) time where w is an integer which is constant. So Q solves the subset-sum problem in O(n) time because W is a constant and input must encoded in binary.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Properties
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon