Question: For this JAVA project, create an instance/object called tourist of a linked list class. The linked list class must have a nested node class that

For this JAVA project, create an instance/object called tourist of a linked list class. The linked list class must have a nested node class that holds the following information about tourists. I have provided sample data for one tourist.

  • Name: Waldo
  • Passport Number: 12345
  • Destination: Prague

The linked list class must have the following methods (you can change the parameter names if you wish):

public void addFirst(String touristName, int passportNumber, String destinationCity)//adds a new tourist to the beginning of the list

public int size() //returns the number of tourists in the list

public String findNode(String touristName) /* finds the tourist's name in the list and returns the destination. Use iteration or recursion to traverse the list */

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!