Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We consider a class Linked List of Persons. The class Person has the following attributes: name (string), and age (int). Write a Java method that
We consider a class Linked List of Persons. The class Person has the following attributes: name (string), and age (int). Write a Java method that receives an object of type Linked list sent as argument and removes all objects having a specific name. Assume that you have the class Person, class Node, and class Linked list. The class Node is: Public class Node Person data Node next For example, if the list was originally and we want to remove all objects having name Ali" first Ali.24 Bilal 23 Ali 30 Said,30 || Dani. 28 Ali, 22 ull then it becomes the same linked list will be: first Bilal,23 Said, 30 Dam 28 null Answer: public void removeObjectsHaving SpecificName(Linkedlist L, String na) {
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