ya range is less, so 0-1 knapsack will work
On Tue, Jan 3, 2012 at 5:21 PM, Prakash D wrote:
> 0-1 knapsack!
>
>
> On Tue, Jan 3, 2012 at 5:14 PM, saurabh singh wrote:
>
>> Most probably noThis is the subset sum problem which is proven NP
>> complete...Even if a better solution than n^2
0-1 knapsack!
On Tue, Jan 3, 2012 at 5:14 PM, saurabh singh wrote:
> Most probably noThis is the subset sum problem which is proven NP
> complete...Even if a better solution than n^2 exists it won't work for all
> cases
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
Most probably noThis is the subset sum problem which is proven NP
complete...Even if a better solution than n^2 exists it won't work for all
cases
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
On Tue, Jan 3, 2012 at 4:56 PM, atul anand wrote:
> }
> output : {1,1,2}, {2,2
There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the
possible combination which will sum to 4.
input : {1,2,4,5,6,1,2,4,3,5,7,2,1}
output : {1,1,2}, {2,2}, {3,1}, {1,2,1}{4}...etc which make the sum as 4
any approach better than O(n^2) ???
--
You received this message beca