Advertisement
olemis

Coursera algs4partII-004 - Assignment 3

Dec 27th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.37 KB | None | 0 0
  1.  
  2. Algorithms, Part II
  3.  
  4. by Kevin Wayne, Robert Sedgewick
  5.  
  6.  
  7. Programming Assignment 3: Baseball Elimination | baseball.zip
  8. Submission time Sat-27-Dec 12:26:06
  9. Raw Score 100.00 / 100.00
  10. Feedback See the Assessment Guide for information on how to read this report.
  11. Assessment Summary
  12. Compilation: PASSED
  13. Style: FAILED
  14. Findbugs: Potential bugs found.
  15. API: PASSED
  16.  
  17. Correctness: 15/15 tests passed
  18. Memory: 4/4 tests passed
  19. Timing: 1/1 tests passed
  20.  
  21. Aggregate score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]
  22. Assessment Details
  23. The following files were submitted:
  24. ----------------------------------
  25. total 16K
  26. -rw-r--r-- 1 9.3K Dec 27 20:27 BaseballElimination.java
  27. -rw-r--r-- 1 2.9K Dec 27 20:27 studentSubmission.zip
  28.  
  29.  
  30. ******************************************************************************
  31. * compiling
  32. ******************************************************************************
  33.  
  34.  
  35. % javac BaseballElimination.java
  36. *-----------------------------------------------------------
  37. ================================================================
  38.  
  39.  
  40.  
  41. % checkstyle *.java
  42. *-----------------------------------------------------------
  43. BaseballElimination.java:29:1: File contains tab characters (this is the first instance).
  44. BaseballElimination.java:66:9: Constructor definition in wrong order.
  45. BaseballElimination.java:77:24: Anonymous inner class length is 25 lines (max allowed is 20).
  46. BaseballElimination.java:79:53: Variable 'iter' must be private and have accessor methods.
  47. BaseballElimination.java:105:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
  48. BaseballElimination.java:129:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
  49. BaseballElimination.java:133:17: Declaring variables, return values or parameters of type 'Integer' is not allowed.
  50. BaseballElimination.java:201:33: Declaring variables, return values or parameters of type 'Integer' is not allowed.
  51. BaseballElimination.java:279:34: Name '_r' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
  52. BaseballElimination.java:313:39: Name '_this' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
  53. BaseballElimination.java:314:32: Anonymous inner class length is 22 lines (max allowed is 20).
  54. BaseballElimination.java:324:51: 'item' hides a field.
  55. BaseballElimination.java:347:22: 'catch' is not followed by whitespace.
  56. BaseballElimination.java:396:43: Name '_teams' must match pattern '^[a-z][a-zA-Z0-9]*$|^[A-Z][A-Z_0-9]*$'.
  57. ================================================================
  58.  
  59.  
  60. % findbugs *.class
  61. *-----------------------------------------------------------
  62. H C NP_ALWAYS_NULL NP: Null pointer dereference of ? in BaseballElimination.against(String, String) Dereferenced at BaseballElimination.java:[line 137]
  63. M D NP_LOAD_OF_KNOWN_NULL_VALUE NP: Load of known null value in BaseballElimination.against(String, String) At BaseballElimination.java:[line 137]
  64. H D DLS_DEAD_LOCAL_STORE DLS: Dead store to $L3 in BaseballElimination.isEliminated(String) At BaseballElimination.java:[line 299]
  65. M C UWF_NULL_FIELD UwF: Field only ever set to null: BaseballElimination.mLastNetwork In BaseballElimination.java
  66. M C UWF_NULL_FIELD UwF: Field only ever set to null: BaseballElimination.mLastTeam In BaseballElimination.java
  67. M P URF_UNREAD_FIELD UrF: Unread field: BaseballElimination$TeamRecords.teamId At BaseballElimination.java:[line 29]
  68. Warnings generated: 6
  69. ================================================================
  70.  
  71.  
  72. Testing the APIs of your programs.
  73. *-----------------------------------------------------------
  74. BaseballElimination:
  75.  
  76. ================================================================
  77.  
  78.  
  79. ******************************************************************************
  80. * correctness
  81. ******************************************************************************
  82.  
  83. Testing methods in BaseballElimination
  84. *-----------------------------------------------------------
  85. Running 15 total tests.
  86.  
  87. Test 1: calls to numberOfTeams()
  88. * teams4.txt
  89. * teams5.txt
  90. * teams8.txt
  91. * teams10.txt
  92. * teams29.txt
  93. * teams48.txt
  94. ==> passed
  95.  
  96. Test 2: calls to teams()
  97. * teams4.txt
  98. * teams5.txt
  99. * teams8.txt
  100. * teams10.txt
  101. * teams29.txt
  102. * teams48.txt
  103. ==> passed
  104.  
  105. Test 3: calls to wins()
  106. * teams4.txt
  107. * teams5.txt
  108. * teams8.txt
  109. * teams10.txt
  110. * teams29.txt
  111. * teams48.txt
  112. ==> passed
  113.  
  114. Test 4: calls to losses()
  115. * teams4.txt
  116. * teams5.txt
  117. * teams8.txt
  118. * teams10.txt
  119. * teams29.txt
  120. * teams48.txt
  121. ==> passed
  122.  
  123. Test 5: calls to remaining()
  124. * teams4.txt
  125. * teams5.txt
  126. * teams8.txt
  127. * teams10.txt
  128. * teams29.txt
  129. * teams48.txt
  130. ==> passed
  131.  
  132. Test 6: calls to against()
  133. * teams4.txt
  134. * teams5.txt
  135. * teams8.txt
  136. * teams10.txt
  137. * teams29.txt
  138. * teams48.txt
  139. ==> passed
  140.  
  141. Test 7: calls to isEliminated()
  142. * teams4.txt
  143. * teams4a.txt
  144. * teams4b.txt
  145. * teams5.txt
  146. * teams5a.txt
  147. * teams5b.txt
  148. * teams5c.txt
  149. * teams7.txt
  150. * teams8.txt
  151. * teams10.txt
  152. * teams12.txt
  153. * teams24.txt
  154. * teams29.txt
  155. * teams30.txt
  156. * teams32.txt
  157. * teams36.txt
  158. * teams42.txt
  159. * teams48.txt
  160. * teams12-allgames.txt
  161. ==> passed
  162.  
  163. Test 8: check that isEliminated() is consistent with certificateOfElimination()
  164. * teams4.txt
  165. * teams5.txt
  166. * teams8.txt
  167. * teams10.txt
  168. * teams29.txt
  169. * teams48.txt
  170. ==> passed
  171.  
  172. Test 9: calls to certificateOfElimination()
  173. * teams4.txt
  174. * teams4a.txt
  175. * teams4b.txt
  176. * teams5.txt
  177. * teams5a.txt
  178. * teams5b.txt
  179. * teams5c.txt
  180. * teams7.txt
  181. * teams8.txt
  182. * teams10.txt
  183. * teams12.txt
  184. * teams24.txt
  185. * teams29.txt
  186. * teams30.txt
  187. * teams32.txt
  188. * teams36.txt
  189. * teams42.txt
  190. * teams48.txt
  191. * teams12-allgames.txt
  192. ==> passed
  193.  
  194. Test 10: only 1 team in division
  195. * teams1.txt
  196. * teams1.txt
  197. * teams1.txt
  198. * teams1.txt
  199. * teams1.txt
  200. * teams1.txt
  201. * teams1.txt
  202. ==> passed
  203.  
  204. Test 11: call certificateOfElimination() before and after calling isEliminated()
  205. * teams4.txt
  206. * teams5.txt
  207. * teams29.txt
  208. ==> passed
  209.  
  210. Test 12: check that certificateOfElimination() returns null
  211. * teams4.txt
  212. * teams5.txt
  213. ==> passed
  214.  
  215. Test 13: check for invalid arguments
  216. * teams4.txt
  217. * teams5.txt
  218. ==> passed
  219.  
  220. Test 14: check for dependence on reference equality of strings
  221. ==> passed
  222.  
  223. Test 15: check whether two Baseball objects can be created at the same time
  224. * teams4.txt and teams5.txt
  225. * teams5.txt and teams7.txt
  226. ==> passed
  227.  
  228.  
  229. Total: 15/15 tests passed!
  230.  
  231. ================================================================
  232.  
  233. ******************************************************************************
  234. * timing
  235. ******************************************************************************
  236.  
  237. Timing BaseballElimination
  238. *-----------------------------------------------------------
  239. Running 1 total tests.
  240.  
  241. N constructor isEliminated() + certificateOfElimination()
  242. ----------------------------------------------------------------
  243. 30 0.04 0.90
  244. 36 0.04 1.94
  245. 42 0.02 4.00
  246. 48 0.02 7.89
  247. 54 0.01 13.97
  248. 60 0.01 23.24
  249. time = 1.11e-07 * N^4.67 (R^2 = 1.00)
  250.  
  251. Total: 1/1 tests passed!
  252.  
  253. ================================================================
  254.  
  255.  
  256.  
  257. ******************************************************************************
  258. * memory
  259. ******************************************************************************
  260.  
  261. Computing memory of BaseballElimination
  262. *-----------------------------------------------------------
  263. Running 4 total tests.
  264.  
  265. Student vertices = 0.50 N^2 + 1.50 N + 2.00 (R^2 = 1.000)
  266. Reference vertices = 0.50 N^2 + -0.50 N + 3.00 (R^2 = 1.000)
  267. => passed
  268. Student edges = 1.50 N^2 + -3.50 N + 2.00 (R^2 = 1.000)
  269. Reference edges = 1.50 N^2 + -3.50 N + 2.00 (R^2 = 1.000)
  270. => passed
  271. Student memory of G = 176.00 N^2 + -304.00 N + 344.00 (R^2 = 1.000)
  272. Reference memory of G = 176.00 N^2 + -384.00 N + 384.00 (R^2 = 1.000)
  273. => passed
  274. Student memory = 61.01 N^2 + 304.03 N + 1670.29 (R^2 = 0.999)
  275. Reference memory = 3.99 N^2 + 222.25 N + 396.00 (R^2 = 1.000)
  276. => passed
  277. Total: 4/4 tests passed!
  278.  
  279. ================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement