To Solve This Problem, I would
1. Sort the given list S by their respective strengths.
2. Then I would create two other lists A and B for respective
partitions.
3. (a) Remove First and Last from S add them both to A
    (b) Remove First and Last from S add them both to B
4. Repeat Step 3 until there is 1 or 0 people left in which if there
is 1 person left we would print NO
0 people we successfully partitioned the teams into equal strengths.

This is just off the top of my head though, so not sure if it will
completely work :)

On Jul 30, 8:37 am, Amol Sharma <amolsharm...@gmail.com> wrote:
> @saurabh- your algo has very high probability of failure
>
> take the case  9,7,8,4,3,1
>
> acc to ur algo
> group 1 is  9,8,3  strength =20
> group 2 is  7,4,2  strength =13
>
> but it is possible to divide them into 2 equal grp's
> take
> G1 - 9,4,3  total =16
> G2 - 7,8,1  total =16
>
> so we have to think of some better algo
> --
>
> Amol Sharma
> Third Year Student
> Computer Science and Engineering
> MNNIT Allahabad
>
>
>
>
>
>
>
> On Sat, Jul 30, 2011 at 5:51 PM, shubham <shubh2...@gmail.com> wrote:
> > hey sylvester,
> > just clarify the problem ..
>
> > Is it such that in forming the group some people can be left out
> > or
> > the sum of the number of people in both partitions is equal to the total
> > number of people
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To view this discussion on the web visit
> >https://groups.google.com/d/msg/algogeeks/-/gVAGoc_nYhAJ.
>
> > 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