1.

What is a subset sum problem?(a) finding a subset of a set that has sum of elements equal to a given number(b) checking for the presence of a subset that has sum of elements equal to a given number and printing true or false based on the result(c) finding the sum of elements present in a set(d) finding the sum of all the subsets of a setThis question was posed to me by my college professor while I was bunking the class.The origin of the question is Checksum, Complexity Classes & NP Complete Problems topic in division Checksum, Complexity Classes & NP Complete Problems of Data Structures & Algorithms II

Answer»

The correct option is (b) checking for the presence of a subset that has sum of elements equal to a given number and printing TRUE or false based on the result

Best EXPLANATION: In subset sum problem CHECK for the presence of a subset that has sum of elements equal to a given number. If such a subset is PRESENT then we print true otherwise false.



Discussion

No Comment Found

Related InterviewSolutions