Question: IN JAVA NO IMPORTS node class: public class node { //instance variables private int score; // the score private String name; // the name of

 IN JAVA NO IMPORTS node class: public class node { //instance

IN JAVA

NO IMPORTS

node class:

public class node { //instance variables private int score; // the score private String name; // the name of the person who scored private node next; // a next variable of type node //constructor public node(int data, String name) { this.score = score; this.name = name; this.next = null; // for now next is set to null to create it } //getters and setters because our variables are private public node getNext() { return next; } public void setNext(node newNext) { this.next = newNext; } public int getScore() { return score; } public void setScore(int newScore) { this.score = score; } public String getName() { return name; } public void setName(String newName) { this.name = newName; } }

DRIVER CLASS:

public class driver { public static void main(String[] args) { singly scoreBoard = new singly(); scoreBoard.add("bob" , 10); scoreBoard.add("craig" , 13); scoreBoard.add("jon" , 5); scoreBoard.add("mary" , 20); scoreBoard.add("greg" , 30); scoreBoard.add("steve" , 10); scoreBoard.add("jones" , 12); scoreBoard.add("jimmy" , 15); scoreBoard.add("sean" , 1); scoreBoard.add("cheryl" , 32); scoreBoard.add("susan" , 26); scoreBoard.viewScoreBoard(); } }

1. Write a program that maintains the top ten scores for a game application, implementing the add and remove methods using a singly linked list instead of an array Answer: 2. Perform the previous project, but use a doubly linked list. Moreover, your implementation of remove(i) should make the fewest number of pointer hops to get to the game entry at index

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!