Question: Question 1 Node.java LinkedList.java For this exercise, you will write two methods for LinkedList class. You need to download Node.java, LinkedList.java. These were discussed in

Question 1

Question 1 Node.java LinkedList.java For this exercise, you will write two methods

Node.java

for LinkedList class. You need to download Node.java, LinkedList.java. These were discussed

LinkedList.java

in the lectures. You will add these two methods to the LinkedListclass and then create a demo program and to test these twomethods. a) Write a method called countWord. It takes in a Stringreturns the number of times the String is contained in the LinkedListpublic int countWord (String word) b) Write a method called lastlndexQf. Ittakes in a String and returns the index of the last occurrence

For this exercise, you will write two methods for LinkedList class. You need to download Node.java, LinkedList.java. These were discussed in the lectures. You will add these two methods to the LinkedList class and then create a demo program and to test these two methods. a) Write a method called countWord. It takes in a String returns the number of times the String is contained in the LinkedList public int countWord (String word) b) Write a method called lastlndexQf. It takes in a String and returns the index of the last occurrence in the list (assume the first element (front) is at index 0). It returns -1 if the item is not in the list. public int lastIndexof (String word) c Write a method called remove which takes in a String as a parameter that removes every occurrence in the LinkedList (note, this is a void method). public void remove (String word)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are the methods you can add to the LinkedList class a Method countWord This method will count t... View full answer

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!