Re: [algogeeks] finding all combination

2012-01-03 Thread shady
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

Re: [algogeeks] finding all combination

2012-01-03 Thread Prakash D
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 >

Re: [algogeeks] finding all combination

2012-01-03 Thread saurabh singh
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

[algogeeks] finding all combination

2012-01-03 Thread atul anand
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