Skip to content

Latest commit

 

History

History

Subset Sum Problem

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum.

Example:

Input: set[] = {3, 34, 4, 12, 5, 2} , sum = 9

Code 1 : using recursion

Code 2 : using DP - Polynomial Space

Code 3 : using DP - Space Optimization [ Linear Space ]