Package com.zybooks.dsaj.fundamental
Class Scoreboard
java.lang.Object
com.zybooks.dsaj.fundamental.Scoreboard
Class for storing high scores in an array in nondecreasing order.
-
Constructor Summary
ConstructorDescriptionScoreboard
(int capacity) Constructs an empty scoreboard with the given capacity for storing entries. -
Method Summary
-
Constructor Details
-
Scoreboard
public Scoreboard(int capacity) Constructs an empty scoreboard with the given capacity for storing entries.
-
-
Method Details
-
add
Attempt to add a new score to the collection (if it is high enough) -
remove
Remove and return the high score at index i.- Throws:
IndexOutOfBoundsException
-
toString
Returns a string representation of the high scores list. -
main
-