Solve this Problem
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

1. Junior Member
Join Date
May 2010
Posts
1

## Solve this Problem

Hi All,

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....

Question:
Given int n, the total number of players and their skill-point. Distribute the players on 2 evenly balanced teams.

2. Elite Member
Join Date
May 2009
Posts
2,413

## Re: Solve this Problem

Originally Posted by veersharma
Given int n, the total number of players and their skill-point. Distribute the players on 2 evenly balanced teams.
So there are N players and they should be divided into two teams.

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.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•