Question: scammer nextLime (); ) 6. Create a search from the tail-first search method to improve your understanding of how to iterate both directions. This method

 scammer nextLime (); ) 6. Create a search from the tail-first

scammer nextLime (); ) 6. Create a search from the tail-first search method to improve your understanding of how to iterate both directions. This method will start from the tail and iterate backward using the previous attribute. public SortedSet searchTailFirst(String searchItem) [ SortedSet sortedSet = new TreeSet(); Node current = tail; if (tail = = mull) { System out.printlo("List is empty" ); return mull; } // System.out.printlo("Nodes of doubly linked list: "); while (current != mull) { /Checks each node by incrementing the pointer. if (current data.name.toLowerCase().contains(searchItem.toLowerCase()_stripOf l| current data mobilePhone.contains(searchItem)) { sortedSet add((PhonebookData) current data); } current = current.previous; ) return sortedSet; ) Once you have added this new method, you can run two consecutive versions of your program, one using head-first search, the other using tail-first, or you could scan for a value before you begin your test, to let the program know which direction you want to search either from the tail or from the head. Your test output

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