Question: IN JAVA NO IMPORTS 1.) NODE CLASS: public class singleNode { private int data; private String name; private singleNode next; public singleNode(int data, String name)

IN JAVA
NO IMPORTS
1.) NODE CLASS:
public class singleNode {
private int data; private String name; private singleNode next;
public singleNode(int data, String name) { this.data = data; this.next = null; this.name = name; } public singleNode getNext() { return next; } public void setNext(singleNode newNext) { this.next = newNext; } public int getData() { return data; } public void setData(int newData) { this.data = newData; } public String getName() { return name; } public void setName(String newName) { this.name = newName; } }
2.) Linked list class should have:
a.) add method
b.) remove method
c.) viewScoreBoard method
3.) 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 i. Answer: 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
Get step-by-step solutions from verified subject matter experts
