@saurabh: see this case
input 100, 1, 1, 1,1

your algo -
group 1 - 100
group 2 - 1 1 1 1

but the group with 2 equal strength can be formed as
G1 - 1 1
G2 - 1 1 or 1 1 each...
i mean it is not necessary to take all the people.....but your algo takes
the the person with max strength at start....which is not correct......there
will be many cases where it will fail....

it might be correct if it is compulsory to take all the persons in the two
groups

a knapsack dp solution will be the best for this particular problem...if u
can thin of any other approach then suggest !!

P.S : Sorry for replying after such a long time  :P
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Mon, Aug 1, 2011 at 2:00 AM, Nitish Garg <nitishgarg1...@gmail.com>wrote:

> Can you explain a bit more?
> Thanks
> Nitish Garg
>
> --
> 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/-/-LiQq0dHHksJ.
>
> 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