CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    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. #2
    Join Date
    May 2009
    Posts
    2,413

    Re: Solve this Problem

    Quote Originally Posted by veersharma View Post
    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.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured