Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algorithms, Part II
- by Kevin Wayne, Robert Sedgewick
- Programming Assignment 3: Baseball Elimination | baseball.zip
- Submission time Sat-27-Dec 12:26:06
- Raw Score 100.00 / 100.00
- Feedback See the Assessment Guide for information on how to read this report.
- Assessment Summary
- Compilation: PASSED
- Style: FAILED
- Findbugs: Potential bugs found.
- API: PASSED
- Correctness: 15/15 tests passed
- Memory: 4/4 tests passed
- Timing: 1/1 tests passed
- Aggregate score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]
- Assessment Details
- The following files were submitted:
- ----------------------------------
- total 16K
- -rw-r--r-- 1 9.3K Dec 27 20:27 BaseballElimination.java
- -rw-r--r-- 1 2.9K Dec 27 20:27 studentSubmission.zip
- ******************************************************************************
- * compiling
- ******************************************************************************
- % javac BaseballElimination.java
- *-----------------------------------------------------------
- ================================================================
- % checkstyle *.java
- *-----------------------------------------------------------
- BaseballElimination.java:29:1: File contains tab characters (this is the first instance).
- BaseballElimination.java:66:9: Constructor definition in wrong order.
- BaseballElimination.java:77:24: Anonymous inner class length is 25 lines (max allowed is 20).
- BaseballElimination.java:79:53: Variable 'iter' must be private and have accessor methods.
- BaseballElimination.java:105:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
- BaseballElimination.java:129:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
- BaseballElimination.java:133:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
- BaseballElimination.java:201:33: Declaring variables, return values or parameters of type 'Integer' is not allowed.
- BaseballElimination.java:279:34: Name '_r' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- BaseballElimination.java:313:39: Name '_this' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- BaseballElimination.java:314:32: Anonymous inner class length is 22 lines (max allowed is 20).
- BaseballElimination.java:324:51: 'item' hides a field.
- BaseballElimination.java:347:22: 'catch' is not followed by whitespace.
- BaseballElimination.java:396:43: Name '_teams' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
- ================================================================
- % findbugs *.class
- *-----------------------------------------------------------
- H C NP_ALWAYS_NULL NP: Null pointer dereference of ? in BaseballElimination.against(String, String) Dereferenced at BaseballElimination.java:[line 137]
- M D NP_LOAD_OF_KNOWN_NULL_VALUE NP: Load of known null value in BaseballElimination.against(String, String) At BaseballElimination.java:[line 137]
- H D DLS_DEAD_LOCAL_STORE DLS: Dead store to $L3 in BaseballElimination.isEliminated(String) At BaseballElimination.java:[line 299]
- M C UWF_NULL_FIELD UwF: Field only ever set to null: BaseballElimination.mLastNetwork In BaseballElimination.java
- M C UWF_NULL_FIELD UwF: Field only ever set to null: BaseballElimination.mLastTeam In BaseballElimination.java
- M P URF_UNREAD_FIELD UrF: Unread field: BaseballElimination$TeamRecords.teamId At BaseballElimination.java:[line 29]
- Warnings generated: 6
- ================================================================
- Testing the APIs of your programs.
- *-----------------------------------------------------------
- BaseballElimination:
- ================================================================
- ******************************************************************************
- * correctness
- ******************************************************************************
- Testing methods in BaseballElimination
- *-----------------------------------------------------------
- Running 15 total tests.
- Test 1: calls to numberOfTeams()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 2: calls to teams()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 3: calls to wins()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 4: calls to losses()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 5: calls to remaining()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 6: calls to against()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 7: calls to isEliminated()
- * teams4.txt
- * teams4a.txt
- * teams4b.txt
- * teams5.txt
- * teams5a.txt
- * teams5b.txt
- * teams5c.txt
- * teams7.txt
- * teams8.txt
- * teams10.txt
- * teams12.txt
- * teams24.txt
- * teams29.txt
- * teams30.txt
- * teams32.txt
- * teams36.txt
- * teams42.txt
- * teams48.txt
- * teams12-allgames.txt
- ==> passed
- Test 8: check that isEliminated() is consistent with certificateOfElimination()
- * teams4.txt
- * teams5.txt
- * teams8.txt
- * teams10.txt
- * teams29.txt
- * teams48.txt
- ==> passed
- Test 9: calls to certificateOfElimination()
- * teams4.txt
- * teams4a.txt
- * teams4b.txt
- * teams5.txt
- * teams5a.txt
- * teams5b.txt
- * teams5c.txt
- * teams7.txt
- * teams8.txt
- * teams10.txt
- * teams12.txt
- * teams24.txt
- * teams29.txt
- * teams30.txt
- * teams32.txt
- * teams36.txt
- * teams42.txt
- * teams48.txt
- * teams12-allgames.txt
- ==> passed
- Test 10: only 1 team in division
- * teams1.txt
- * teams1.txt
- * teams1.txt
- * teams1.txt
- * teams1.txt
- * teams1.txt
- * teams1.txt
- ==> passed
- Test 11: call certificateOfElimination() before and after calling isEliminated()
- * teams4.txt
- * teams5.txt
- * teams29.txt
- ==> passed
- Test 12: check that certificateOfElimination() returns null
- * teams4.txt
- * teams5.txt
- ==> passed
- Test 13: check for invalid arguments
- * teams4.txt
- * teams5.txt
- ==> passed
- Test 14: check for dependence on reference equality of strings
- ==> passed
- Test 15: check whether two Baseball objects can be created at the same time
- * teams4.txt and teams5.txt
- * teams5.txt and teams7.txt
- ==> passed
- Total: 15/15 tests passed!
- ================================================================
- ******************************************************************************
- * timing
- ******************************************************************************
- Timing BaseballElimination
- *-----------------------------------------------------------
- Running 1 total tests.
- N constructor isEliminated() + certificateOfElimination()
- ----------------------------------------------------------------
- 30 0.04 0.90
- 36 0.04 1.94
- 42 0.02 4.00
- 48 0.02 7.89
- 54 0.01 13.97
- 60 0.01 23.24
- time = 1.11e-07 * N^4.67 (R^2 = 1.00)
- Total: 1/1 tests passed!
- ================================================================
- ******************************************************************************
- * memory
- ******************************************************************************
- Computing memory of BaseballElimination
- *-----------------------------------------------------------
- Running 4 total tests.
- Student vertices = 0.50 N^2 + 1.50 N + 2.00 (R^2 = 1.000)
- Reference vertices = 0.50 N^2 + -0.50 N + 3.00 (R^2 = 1.000)
- => passed
- Student edges = 1.50 N^2 + -3.50 N + 2.00 (R^2 = 1.000)
- Reference edges = 1.50 N^2 + -3.50 N + 2.00 (R^2 = 1.000)
- => passed
- Student memory of G = 176.00 N^2 + -304.00 N + 344.00 (R^2 = 1.000)
- Reference memory of G = 176.00 N^2 + -384.00 N + 384.00 (R^2 = 1.000)
- => passed
- Student memory = 61.01 N^2 + 304.03 N + 1670.29 (R^2 = 0.999)
- Reference memory = 3.99 N^2 + 222.25 N + 396.00 (R^2 = 1.000)
- => passed
- Total: 4/4 tests passed!
- ================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement