Question: 1 : 2 6 : 5 1 remaining private Node first; / / first node of the list / * Other LinkedIntList methods not listed

1:26:51 remaining
private Node first; // first node of the list
/* Other LinkedIntList methods not listed here for the
sake of space */
public LinkedIntList(){
first = null;
}
}
/* Other LinkedIntList methods not listed here for the Other than constructors, you should not call any methods in the code your write.
This includes methods you, yourself write, so recursion is not allowed either. As long
tas your solution is not recursive, it might still be possible to get some partial credit if
you call methods in your code, so writing down a solution that calls other methods is
preferable to leaving the question blank.Question 7(20 points)
Implement a count method for the LinkedIntList class you worked on for
HW4. This method takes an int argument and returns the number of times
the int argument appears in the list. For example, if the list example contained
the numbers 4,-1,2,7,-1,3 in that order, then example . count (-1) should
return 2 and example. count (5) should return 0.
In the text area below, write the definition of the count method. (In other words,
write the code that should replace the //TODO comment.) Your code cannot call any.
methods.
Public class LinkedIntList {
 1:26:51 remaining private Node first; // first node of 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!