Please Help me I will give thumbs up Follow the task in the skeleton code. public class DoublyLinkedList {    // define ListNode elements specific for this type of list, indicating current, previous and next    // consider head as name for previous node, and tail for the next one. private ListNode head; private ListNode current; private ListNode tail;    // default constructor    public DoublyLinkedList() {        //*** Task #1: implement a default constructor here, initializing the nodes to null }    // method that calculates the length of the list public int length() {        //*** Task #2: implement the method navigating through the list until you run out of elements } public void addANodeToStart(E addData) {        //*** Task #3: implement this method, taking into consideration that the head will be replaced by a new node. You may want to use a temporary variable }    // accessor method that gets data at current node public E getDataAtCurrent() {        //*** Task #4: implement this method making sure to take into account the situation when        // there current doesn't point to any data (is null) }    // method that sets the current node in the beginning, reseting the iteration public void resetIteration() {        //*** Task #5: implement the body of the method }    // method that checks if there is more to interate in the list public boolean moreToIterate() {        //*** Task #6: implement the body of the method } public void goToNext() {        //*** Task #7: implement the method taking into account the situation when the list is empty        // check if there are other instances when the move is not possible. }    // method that resets the reverse iteration, setting the current node to the last one public void resetIterationReverse() {        //*** Task #8: implement the body of the method }    // method that facilitates the move in the reverse directions, redirecting the node to previous public void goToPrevious() {        //*** Task #9: implement this method in a similar way the goToNext() method // make sure to have the right links for the reverse navigations } /* Method that inserts node with newData after the current node. Note: The current node is the same after invocation as it is before invocation. Should not be used with an empty list. Should not be used when the current node has iterated past the entire list. */ public void insertNodeAfterCurrent(E newData) {        //*** Task #10: implement this method, making sure to observe the ideas noted above } /* Method that deletes the current node. After the invocation, the current node is the node after the deleted node or null if there is no next node. */ public void deleteCurrentNode() {        //*** Task #11: implement this method, making sure to observe the ideas noted above }    // method that deletes the head node. public void deleteHeadNode() {        //*** Task #12: implement this method } // Searches list for element containing target data. // If target is found, current is set to point at it, // and the function returns true. // If target is not found, current is set to null // and the function returns false. public boolean findInList(E target) {        //*** Task #13: implement this method, making sure to observe the ideas noted above    } public boolean onList(E target) {        //*** Task #14: implement this method } private ListNode Find(E target) {        //*** Task #15: implement this method }    // meethod that displays the list public void showList() {        //*** Task #16: irrespective of navigation through the list, the display remains the same // start from the head and move through the list to show all elements. } // Method useful during testing and debugging, that allows control over the nodes. public void showListState() { System.out.println("Head: " + (head == null ? "null" : head.data) + " Current: " + (current == null ? "null" : current.data) + " Tail: " + (tail == null ? "null" : tail.data) + " " + length() + " items"); }    // inner class for ListNode public class ListNode {        // instance variables private E data; private ListNode link; private ListNode previous;        // constructor - default public ListNode() {        //*** Task #17: implement this constructor        }        // constructor, fully defining the list public ListNode(E newData, ListNode linkValue, ListNode previousValue) {        //*** Task #18: implement this constructor }        // mutator for data public void setData(E newData) {        //*** Task #19: implement this method        }        // accessor for data public E getData() {        //*** Task #20: implement this method        }        // mutator for the node public void setLink(ListNode newLink) {        //*** Task #21: implement this method        }        // mutator for the previous node public void setPrevious(ListNode newPrevious) {        //*** Task #22: implement this method        }        // accessor for the current node public ListNode getLink() {        //*** Task #23: implement this method        }        // accessor for the previous node public ListNode getPrevious() {        //*** Task #24: implement this method        } } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Please Help me I will give thumbs up

Follow the task in the skeleton code.

public class DoublyLinkedList
{
   // define ListNode elements specific for this type of list, indicating current, previous and next
   // consider head as name for previous node, and tail for the next one.
private ListNode head;
private ListNode current;
private ListNode tail;

   // default constructor
   public DoublyLinkedList()
{
       //*** Task #1: implement a default constructor here, initializing the nodes to null

}

   // method that calculates the length of the list
public int length()
{
       //*** Task #2: implement the method navigating through the list until you run out of elements

}

public void addANodeToStart(E addData)
{
       //*** Task #3: implement this method, taking into consideration that the head will be replaced by a new node. You may want to use a temporary variable

}

   // accessor method that gets data at current node
public E getDataAtCurrent()
{
       //*** Task #4: implement this method making sure to take into account the situation when
       // there current doesn't point to any data (is null)

}

   // method that sets the current node in the beginning, reseting the iteration
public void resetIteration()
{
       //*** Task #5: implement the body of the method
}

   // method that checks if there is more to interate in the list
public boolean moreToIterate()
{
       //*** Task #6: implement the body of the method
}


public void goToNext()
{
       //*** Task #7: implement the method taking into account the situation when the list is empty
       // check if there are other instances when the move is not possible.

}

   // method that resets the reverse iteration, setting the current node to the last one
public void resetIterationReverse()
{
       //*** Task #8: implement the body of the method
}

   // method that facilitates the move in the reverse directions, redirecting the node to previous
public void goToPrevious()
{
       //*** Task #9: implement this method in a similar way the goToNext() method
// make sure to have the right links for the reverse navigations
}

/*
Method that inserts node with newData after the current node.
Note: The current node is the same after invocation as it is before invocation.
Should not be used with an empty list.
Should not be used when the current node has iterated past the entire list.
*/
public void insertNodeAfterCurrent(E newData)
{
       //*** Task #10: implement this method, making sure to observe the ideas noted above
}

/*
Method that deletes the current node. After the invocation,
the current node is the node after the
deleted node or null if there is no next node.
*/
public void deleteCurrentNode()
{
       //*** Task #11: implement this method, making sure to observe the ideas noted above
}

   // method that deletes the head node.
public void deleteHeadNode()
{
       //*** Task #12: implement this method

}

// Searches list for element containing target data.
// If target is found, current is set to point at it,
// and the function returns true.
// If target is not found, current is set to null
// and the function returns false.
public boolean findInList(E target)
{
       //*** Task #13: implement this method, making sure to observe the ideas noted above

   }

public boolean onList(E target)
{
       //*** Task #14: implement this method
}

private ListNode Find(E target)
{
       //*** Task #15: implement this method
}

   // meethod that displays the list
public void showList()
{
       //*** Task #16: irrespective of navigation through the list, the display remains the same
// start from the head and move through the list to show all elements.
}
// Method useful during testing and debugging, that allows control over the nodes.
public void showListState()
{
System.out.println("Head: " + (head == null ? "null" : head.data)
+ " Current: " + (current == null ? "null" : current.data)
+ " Tail: " + (tail == null ? "null" : tail.data)
+ " " + length() + " items");
}

   // inner class for ListNode
public class ListNode
{
       // instance variables
private E data;
private ListNode link;
private ListNode previous;
       // constructor - default
public ListNode()
{
       //*** Task #17: implement this constructor
       }
       // constructor, fully defining the list
public ListNode(E newData, ListNode linkValue, ListNode previousValue)
{
       //*** Task #18: implement this constructor
}
       // mutator for data
public void setData(E newData)
{
       //*** Task #19: implement this method
       }
       // accessor for data
public E getData()
{
       //*** Task #20: implement this method
       }
       // mutator for the node
public void setLink(ListNode newLink)
{
       //*** Task #21: implement this method
       }
       // mutator for the previous node
public void setPrevious(ListNode newPrevious)
{
       //*** Task #22: implement this method
       }
       // accessor for the current node
public ListNode getLink()
{
       //*** Task #23: implement this method
       }
       // accessor for the previous node
public ListNode getPrevious()
{
       //*** Task #24: implement this method
       }
}
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education