GATE CS 2008 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0128

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?
  1. A
    Q solves the subset-sum problem in polynomial time when the input is encoded in unary
  2. B
    Q solves the subset-sum problem in polynomial time when the input is encoded in binary
  3. C
    The subset sum problem belongs to the class NP
  4. D
    The subset sum problem is NP-hard

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/456/gate2008-44

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com