By using a doubly linked list instead of array, complete the project that maintains the top N scores for a game application (prompt for input for N, a positive integer).
Four Java classes are given and only one is incomplete for your implementation, which is, DoublyLinkedScoreboard. Specifically,
1)complete method add(GameEntry e): add a new score to the collectionin the right place.
2)complete method remove(int i): remove and return the high score element at index in the collection.
3)You may not make changes on other classes (except for testing temporarily).
The output from the testing class looks like the following (please note: I will use different case for testing your implementation):
How many highest scores on the scoreboard? 6
Testing DoublyLinkedList--addFirst:
List contents:
((Bob, 400), (Paul, 720), (Anna, 660), (Jack, 510), (Jill, 740), (Rose, 590), (Mike, 1105), (Rob, 750))
Testing DoublyLinkedList--addLast:
List contents:
((Rob, 750), (Mike, 1105), (Rose, 590), (Jill, 740), (Jack, 510), (Anna, 660), (Paul, 720), (Bob, 400))
Scoreboard created :
[(Mike, 1105), (Rob, 750), (Jili, 740), (Paul, 720), (Anna, 660), (Rose, 590)]
Now operations on scoreboard:
Removing at index 3 [(Mike, 1105), (Rob, 750), (Jill, 740), (Anna, 660), (Rose, 590)]
Removing at index 0 [(Rob, 750), (Jill, 740). (Anna, 660), (Rose, 590)]
Removing score at index 1 [(Rob, 750), (Anna, 660), (Rose, 590)]
Removing score at index 1 [(Rob, 750), (Rose, 590)]
Removing score at index [(Rose, 590)]