But the same solution I've given above can give you the solution for this
problem .
In the formed table of P[i][j] , you can take another variable attached to
it as count[i][j] for how many items we have selected yet.
So you gotta find , the max. value of j which has count = 50.
count[i][j] = count[i-1][j]                       if P(i-1,j) ==1
count[i][j] = count[i-1][j-a[i]]                  if P(i-1,j-a[i]) ==1
else count[i][j] = 0





On Thu, Dec 30, 2010 at 11:42 AM, vishal raja <vishal.ge...@gmail.com>wrote:

> yeah, My bad.
> Missed that.
>
>   On Wed, Dec 29, 2010 at 10:52 PM, Wladimir Tavares <
> wladimir...@gmail.com> wrote:
>
>> Sum up all the number and divide by 2
>>
>> Using the algorithm subset problem to find a number close to median
>>
>>
>> Wladimir Araujo Tavares
>> *Federal University of CearĂ¡
>>
>> *
>>
>>
>>
>>
>>
>> On Wed, Dec 29, 2010 at 2:07 PM, Ankur Khurana 
>> <ankur.kkhur...@gmail.com>wrote:
>>
>>> How will you divide and array of approx 100 elements into two sub sets
>>> of 50 each such that the difference between both the subsets is the
>>> minimum possible one . .
>>>
>>>  Thanks in advance .
>>> Ankur
>>>
>>> --
>>> 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<algogeeks%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>> --
>> 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<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to