Question: e following class represents a node in a doubly-linked list: class DLLNode ( private Integer data: private DLLNode previ private DLLNode nexti // previous node

 e following class represents a node in a doubly-linked list: class

e following class represents a node in a doubly-linked list: class DLLNode ( private Integer data: private DLLNode previ private DLLNode nexti // previous node in the list // next node in the list f this.data data;1I ctor f return prev; ) DLLNode(Integer data) Integer getData) DLLNode getPrev() DLLNode getNext) void setPrev (DLLNode prev) void setNext (DLLNode next) // getter // getter // getter return data; return nexti this.prev prev; I setter this.next next; 1/ setter The list class that uses this node class is: class DLList ( private DLLNode head; private DLLNode tail; DLLNode getHead () 1 return head; DLLNode getTail) f return tail; ) Write the following methods for the DLList class. Don't worry about imports or integrity. (10 pts each ) A) void insertBeforeHead (DLLNode n) for the DLList class. B) void appendAfterTail (DLLNode n) for the DLList class. C) int length() returns the number of nodes in the current list. D) public boolean equals (object x) 2 instances are equal if they are the same length, and the nth nodes in each list contain equal data. E) ArrayList getDataInListorder returns an array list containing the data fields F ArrayList getDataInNumericalOrder returns an array list containing the of the nodes, in the order of appearance in the linked list. data fields of the nodes, in ascending numerical order. Assume all nodes have unique data, and data is never null. Zero points for implementing any sorting algorithm; just use a simple technique that you've often seen this semester

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!