Re: [algogeeks] Re: Modified subset-sum problem

2010-08-31 Thread Wladimir Tavares
negative numbers aren't important because could find the maximum negative (for instance, -M) number and then create a new set {a+M for all a in initial set } Wladimir Araujo Tavares http://www.si.ufc.br/~wladimir "Fiz uma faculdade! Só não fiz a segunda porq

Re: [algogeeks] Re: Modified subset-sum problem

2010-08-31 Thread Wladimir Tavares
given a set of n number a_i sum up to M ,you use 2 dimensional table array m[0..M], m[i][b] indicate whether b can be hit using only {a_1,a_2,...,a_i},where each row only depends on the previous rows. the inner j-loop check if the previous row m[i][j-arr[i]] can be hit then m[i+1][j] will be hit.

Re: [algogeeks] Re: Modified subset-sum problem

2010-08-31 Thread Chi Hoang
Pairs of: ['1_2'] ['1_3'] ['1_4'] ['1_5'] ['1_6'] ['1_7'] ['2_3'] ['2_4'] ['2_5'] ['2_6'] ['2_7'] ['3_4'] ['3_5'] ['3_6'] ['3_7'] ['4_5'] ['4_6'] ['4_7'] ['5_6'] ['5_7'] ['6_7'] N^2-(N-1). Am 31.08.2010 14:37, schrieb Maria: > @Wladmir- Can u plz explain ur code??? > > -- You received this

[algogeeks] Re: Modified subset-sum problem

2010-08-31 Thread Maria
@Wladmir- Can u plz explain ur code??? -- 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 unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For