Posts

Showing posts with the label doulblylinkedlist in java

CS3401 Assignment 6

Homework Assignment #6 Exercise #1 Write an implementation of a generic version of MyLinkedList.java and its methods. In addition, you must modify the MyLinkedList class in the following ways while maintaining a generic implementation of this class: Make the MyLinkedList class a doubly linked list . This means adding to the Node inner class the following field which also starts off equal to null : public Node prev; As the program works now, the " list " field in the main MyLinkedList class always points to the first element in the linked list. Add a " last " field as well that always points to the last element. public Node last; Note: this field is not stored in the Node inner class. Modify the toString() method of the MyLinkedList class so that it returns a string consisting of all of the elements of the list from first to last on one line separated by commas with "<" in the front and ">" at...