Recall the remove method of a single linked list. Here is an alternative remove method for the
Question:
Recall the remove method of a single linked list. Here is an alternative remove method for the SLinkedListRec class which removes the node having the first occurrence of data from a single linked list. The method calls a recursive helper method removeRec which does most of the work.
Find uploaded the SLinkedListRec class. Implement and append the remove method and the helper method removeRec defined below to the SLinkedListRec class.
private boolean removeRec(Node cur, Node prev, E outData) {
}
public boolean remove(E data){
}
Write a tester class that tests the remove method, as well as size(), toString(), replace(), and add() methods implemented in class.
For testing purposes, we will unify the class E. Consider E to be a class called Team. The Team class
should have the following attributes and methods:
private attribute: name of type String, representing the Teams name.
private attribute: country of type String, representing the country of the Team.
a constructor that takes the name and country as parameters
getters and setters
toString method of the format: Team_name, TeamCountry. Example: PSG, France