May 29th, 2010, 06:15 AM
Solve this Problem
Can someone find a solution / approach to the problem below. I am looking for best approach (time / space) and request an open discussion on the same from members....
Given int n, the total number of players and their skill-point. Distribute the players on 2 evenly balanced teams.
May 30th, 2010, 07:19 AM
Re: Solve this Problem
So there are N players and they should be divided into two teams.
Originally Posted by veersharma
The question is should each team have the same number of players? In that case there's a common and very simple distribution strategy. The two best players become captains for each one team and then they take turns to pick a player for their team until all players are chosen. It's understood that the best remaining player (the one with the highest skill-point) is always selected next.
I don't know if this strategy is optimal but I do know it's considered fair by every kid above the age of seven or so.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!