/* vim: set expandtab tabstop=4 shiftwidth=4 : */ public class BaseballElimination { public BaseballElimination(String filename) { // create a baseball division from given filename in format specified below } public int numberOfTeams() { // number of teams return 0; } public Iterable teams() { // all teams return null; } public int wins(String team) { // number of wins for given team return 0; } public int losses(String team) { // number of losses for given team return 0; } public int remaining(String team) { // number of remaining games for given team return 0; } public int against(String team1, String team2) { // number of remaining games between team1 and team2 return 0; } public boolean isEliminated(String team) { // is given team eliminated? return false; } public Iterable certificateOfElimination(String team) { // subset R of teams that eliminates given team; null if not eliminated return null; } public static void main(String[] args) { BaseballElimination division = new BaseballElimination(args[0]); for (String team : division.teams()) { if (division.isEliminated(team)) { StdOut.print(team + " is eliminated by the subset R = { "); for (String t : division.certificateOfElimination(team)) StdOut.print(t + " "); StdOut.println("}"); } else { StdOut.println(team + " is not eliminated"); } } } }