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

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 Programming Questions!