Question: Java public class DoubleNode { private double data; private DoubleNode link; public DoubleNode (double data, DoubleNode link) { this.data = data; this.link - link; }

Java
public class DoubleNode { private double data; private DoubleNode link; public DoubleNode (double data, DoubleNode link) { this.data = data; this.link - link; } public double getData() {return data;} public DoubleNode getLink() {return link;} public void setData(double data) {this.data = data; } public void setLink(DoubleNode link) {this.link = link;} } // close DoubleNode public class DoublelinkedList { private DoubleNode top; public void addToStart(double data) { DoubleNode newlode = new DoubleNode (data, top); top = newNode; } } // close Doublelinked List Complete the following instance method for the Double LinkedList class above. The method should move the DoubleNode at the position passed as a parameter to the end of the list. For example moveToEnd(2) should move the 3rd DoubleNode in the list to the end of the list. If there is no such DoubleNode, the method should do nothing. public void moveToEnd(int pos) {
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
