Question: 1. Defined a new class named SortedLinkedList that implements a sorted linked list. Defined the data members of the class. Then list the methods needed.

1. Defined a new class named SortedLinkedList that implements a sorted linked list. Defined the data members of the class. Then list the methods needed. They should include size(), isEmpty(), find(), add(), remove(), in addition to the class constructor and toString()

2. Create a new project with public class SortedLinkedList. Add class node and the private data members. Implement the class constructor and toString().

3. Implement method add(). The add method should add nodes in ascending order of the value field of the nodes. Test your method with enough cases to verify it meets specifications.

4. Implement the add() and remove() method and test them.

5. Demo your program. Copy your code of exercise 4 and a screenshot of a program run showing methods add() and remove() meet specifications.

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!