a[]={-3,2,4,-6,-8,10,11}
create an array with cumulative sum: b[]={-3,-1,3,-3,-11,-1,10}. Now
identify the maximum index distance same value. in this case distance b/w
-3,-3 is maximum so subarray would be 2,4,-6,-8,10


On Wed, Dec 15, 2010 at 6:23 PM, Soumya Prasad Ukil
<ukil.sou...@gmail.com>wrote:

> It's a subset-sum problem, I guess.
>
>
> On 15 December 2010 04:12, parth panchal <parthpancha...@gmail.com> wrote:
>
>> HI HOW ARE YOU
>>
>>
>> On Tue, Dec 14, 2010 at 7:45 PM, divya <sweetdivya....@gmail.com> wrote:
>>
>>> an array contain +ve and -ve element, find subarray whose sum =0;
>>>
>>> Lets take input array as a[]={-3,2,4,-6,-8,10,11}
>>>
>>> --
>>> 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.
>>
>
>
>
> --
> regards,
> soumya prasad ukil
>
> --
> 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