Question: In this problem you ll add a countNegative method to an existing linked list implementation. You should create a public non - final class named
In this problem youll add a countNegative method to an existing linked list implementation.
You should create a public nonfinal class named YourSimpleLinkedList that extends SimpleLinkedList. Your class should override protected int countNegative and return the count of the number of items in the list with values less than zero. Note that this list only stores ints, not objects, so you do not need to cast Item values to work with them as ints.
While there are both recursive and iterative solutions to this problem, we expect you to solve it iteratively by following references from the start to the end of the list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
