Question: Linked List Basics ( insertFront, insertBack, deleteFront & deleteBack) Update Lab 9 and ... Add the deleteFront and delete Back methods. 1) Add the java
Linked List Basics ( insertFront, insertBack, deleteFront & deleteBack)
Update Lab 9 and
...
Add the deleteFront and delete Back methods.
1)
Add the java lines of code in yellow (Or you can copy-
2)
and-paste the method main below.)
public static void main(String[] args) {
LinkedList list = new LinkedList();
// Try to delete from an empty list
list.deleteFront();
list.displayLL();
list.deleteBack();
list.displayLL();
// insert 3 nodes
list.insert(18);
list.insert(45);
list.insert(12);
list.displayLL();
// Here are the main "new" lines, not included in code I gave you
list.insertFront(1);
list.displayLL();
list.insertBack(999);
list.displayLL();
OVER
list.deleteFront();
list.displayLL();
list.deleteBack();
list.displayLL();
} // end of main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
