0
votes

I'm trying to find my to understand and start coding my assignment. We were asked to make a program for score game to set (String name, int score)in descending order. We are restricted to make it as a Doubly Linked List and the node data contain Name and Score, implementation we will do is storing them in descending order, add node, delete node, get node in i position. What I'm thinking of right now, is it a good idea to get the name and score as a HashMap? Am I able to do the implementation in an efficient way?If not HashMap how to store name and score in one node and make the implementations?

1

1 Answers

0
votes

how to store name and score in one node...

class Node {
    public final String name;
    public final int score;

    public Node(String name, int score) {
        this.name = name;
        this.score = score;
    }
}

Of course, you might want to add some other fields and probably some methods if you want to link your Node objects to one another in a doubly linked list.