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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started