Re: [algogeeks] compute all subset in given array

2010-11-02 Thread Lego Haryanto
Out of topic, ... but this examples remind me a lot about a good cribbage hand. Best, -Lego On Mon, Nov 1, 2010 at 10:49 AM, RIDER wrote: > given an array how to find number of set which results to give a > particular sum ( consider continues, noncontinue) both. > > example [5, 5, 10, 2, 3] sho

Re: [algogeeks] compute all subset in given array

2010-11-02 Thread LALIT SHARMA
Have a look at this code #include #include using namespace std ; int main() { int n ; cin >> n; int a[n] ; for(int i=0;i> a[i] ; for(int i=1;i<=pow(2,n);i++){ for(int j=0;j wrote: > given an array how to find number of set which results to give a > particular s

Re: [algogeeks] compute all subset in given array

2010-11-01 Thread vishnuvarthan m
@rider using bit wise operators you'll easily generate all subsets refer topcoder tutorials(fun with bits).. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsub

[algogeeks] compute all subset in given array

2010-11-01 Thread RIDER
given an array how to find number of set which results to give a particular sum ( consider continues, noncontinue) both. example [5, 5, 10, 2, 3] should return 4 (5 + 10, 5 + 10, 5 + 5 + 2 + 3, 10 + 2 + 3 can we do any logical thing to computer sum if range is known?? -- You received this mess