Question: Finish the following methods in the LinkedList.java file. Note, these problems are inspired from 17.8, 17.9, 17.14 and 17.17 These are the given methods. Please

Finish the following methods in the LinkedList.java file. Note, these problems are inspired from 17.8, 17.9, 17.14 and 17.17 These are the given methods. Please keep parameters' data types.

public static int listSize( LinkedList theList ) {

}

public void insertEnd( AnyType x ) {

}

public void removeLast(AnyType x) {

}

public void removeAll(String item) {

}

public Node previous(AnyType x) {

return null;

}

public Node findAndMoveToFront(AnyType x) {

return null;

}

listSize - This method determines the size of the LinkedList provided

nd - This method is like insertFront except the item goes at the end of the list, not the beginning

removeLast - This method is like the remove method, except it removes that last occurrence of the item

removeAll - This method remove all items that match the provided item

previous - The method returns the node in front of the item

findAndMoveToFront - The method returns the first node containing the item, but as a side effect it also moves that node to the first of the list. This potentially makes future searches faster. This is called the move to front search heuristic.

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!