Question: 5.1 Write a Java program which stores integer numbers by using doubly linked list. (70 points) 1) Define a Node class -stores one element at

5.1 Write a Java program which stores integer numbers by using doubly linked list. (70 points) 1) Define a Node class -stores one element at least. 2) Define a Doubly linked list class which must has following methods: * getSize) //Returns the number of elements in the list. * isEmpty() //Returns true if the list is empty, and false otherwise. * getFirst() //Returns the first element in the list. * . * * getLast) //Returns the last element in the list addFirst(e) //Adds a new element to the front of the list. addLast(e) //Adds a new element to the end of the list. removeFirst() //Removes and returns the first element of the list. * removeLast() //Removes and returns the last element of the list. * displayList() /Displays all elements of the list by traversing the linked list. 3) Define a Test class - initialize a doubly linked list instance. Test all methods of doubly linked list class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
