@adarsh why have we taken an assumption of the average to be integer all
the time it  could be float as well?
@prem how could we find all possible subsets in tc-O(n2) as it will clearly
be exponential...

On Sat, May 19, 2012 at 8:58 AM, Gene <gene.ress...@gmail.com> wrote:

> We discussed this some time ago.  It's NP hard.  So an algorithm that
> gets the correct answer every time will run in exponential time.  You
> can do it in pseudo-polynomial time -- polynomial in the magnitude of
> the elements - by using the DP method used for subset sum.
>
> On May 18, 2:35 am, payal gupta <gpt.pa...@gmail.com> wrote:
> >  How do you partition an array into 2 parts such that the two parts have
> > equal average?...each partition may contain elements that are
> > non-contiguous in the array...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@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