Question: How to implement these methods in java using the class, explain how to connect them and such. public class LinkedList { private Node head; public

How to implement these methods in java using the class, explain how to connect them and such.

 public class LinkedList { private Node head; public class Node { private Node next; private String name; private int ID; constructor public Node(String name, int ID) { this.next = null; this.name = name; this.ID = ID; } new Linked list constructor
public newLL() { Node newNode = new Node(null, -2); head = newNode; }
 
 create new Node, add to the end of the Linked List public void addLast(String name, int ID) { }

remove the first node of LinkedList public void Firstremove() { }
 remove the last node of Linked List public void Lastremove() { }

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!