java - 多个项目之间的排序算法,而不仅仅是两个项目(篮球)之间的排序算法?

标签 java php algorithm sorting data-structures

我们需要对篮球队进行分类。

程序在这里供引用:

D.1 Procedure
Teams shall be classified according to their win-loss records, namely two (2) points
for each game won, one (1) point for each game lost (including lost by default) and
zero (0) points for a game lost by forfeit.

D.1.1 If there are two (2) teams in the classification with equal points, the result(s) of the
game(s) between the two (2) teams involved will be used to determine the placing.

D.1.2 If the points and the goal average in the games between the two (2) teams are still
the same, the classification will be determined by the goal average of all the games
played in the group by each team.

D.1.3 If there are more than two (2) teams in the classification with equal points, a second
classification will be established, taking into account only the results of the games
between the involved teams.

D.1.4 If at any stage of this procedure the number of teams with equal points is reduced
to only two (2) teams, the procedure in D.1.1 and D.1.2 above will be applied.

D.1.5 If in the second classification there are still teams with equal points, the goal
average will be used to determine the placing, taking into account only the results
of the games between the involved teams.

D.1.6 If there are still more than two (2) teams with the same goal average, the placing
will be determined using the goal average from the results of all their games played
in the group.

D.1.7 If at any stage of this procedure the number of teams with equal points is reduced
to a tie still involving more than two (2) teams, the procedure, beginning with D.1.3
above, is repeated.

D.1.8 Goal average will always be calculated by division.

问题是如何处理 D.1.3 部分,该部分说:如果在分类中有超过两 (2) 支球队得分相同,则第二支球队 将建立分类,仅考虑比赛结果 如何对第二个分类进行建模以及如何根据他们之间的游戏结果做出决策?

最佳答案

对于积分相等的 k 个球队,构建一个较小的“联赛表”,大小为 k,其中将仅根据这些球队之间的比赛来填充积分和进球数。

在这个较小的表上递归地激活排序过程。

如果在 2 次递归调用之间没有团队减少 [团队完全相等] 或建立完整排名,则停止。如果列表仅由两支得分相同的球队组成:适用次要标准。

关于java - 多个项目之间的排序算法,而不仅仅是两个项目(篮球)之间的排序算法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8175003/

相关文章:

java - 了解C++,学习Java需要多长时间?

java - 获取 ImageView 可绘制 ID 并使用 AsyncTask 更改它

php - 只获取第一个条目 php mysql

algorithm - 找到小于数字的最大 x^y

arrays - 查找给定值的所有数组子序列

java - 如何停止并重新启动 Android 定位服务

PHP mail() 函数不发送电子邮件

php - 检查是否已经使用 PHP SDK 4.0 登录到 facebook

使用贪心策略的算法思想

java - Facebook 的 Spring Social - 获取用户位置