Question: public class Link { private E e; // the element contained in this linked list private Link next; // the next element of the linked
public class Link{ private E e; // the element contained in this linked list private Link next; // the next element of the linked list public Link(E e, Link n) { this.e = e; this.next = n; } /** * Method to set the element */ public void setElement(E e) { this.e = e; } /** * Method to set the next linked list element */ public void setNext(Link e) { this.next = e; } /** * Method to get the element. */ public E getElement() { return this.e; } /** * Method to get the next linked list element */ public Link getNext() { return this.next; } }


In the Link.java, you will see an implementation of Link class as described in the lecture. In this lab, you will implement a class called StackLinkedList.java. The class should use a generic (StacklinkedList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
