Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in Java public class DoubleNode { private double data; private DoubleNode link; public DoubleNode (double data, DoubleNode link) { this.data = data; this.link -

Write in Java image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions