+LinkedList()
+isEmpty():Boolean
+size():int
+insertAtFront(int): void
+insertAtBack(int):void
+removeFromFront():Integer
+removefromBack():Integer
1- Add a method called โfindโ to the class โLinkedListโ that receives an integer and
returns an index of the first node containing that integer -1 if not found.
2- Add a method called โprintLastโ to the class โLinkedListโ that print the data in the last
node.
3- In another class, implement a method called โfindโ that receives a reference to a
LinkedList object and an integer, and returns an index of the first node containing that
integer -1 if not found. This method should not change the elements order
4- Consider the following method removeAll that receives a LinkedList object and an
integer. The method should remove all nodes containing that integer from the received
list.
public void removeAll (LinkedList myList, int x)
{
if (myList.isEmpty())
return;
int i=0;
while (i<myList.size())
{
int temp= myList."removeFromFront();
if (temp!=x)
myList."insertAtBack(temp)
i++;
}}