Question: please write the program in java Create a linked list implementation of an Orderedset class that contains a collection of unique objects. More formally, a

 please write the program in java Create a linked list implementation

please write the program in java

Create a linked list implementation of an Orderedset class that contains a collection of unique objects. More formally, a set contains no pair of elements e1 and 2 such that el.compare fez) . Also, make sure that the set elements are always maintained in ascending order. The Set class should have the following methods Set o Create an empty set Add an item if the item does not exist in the set. If the item already exists, do nothing. Add should insert the element at the correct position and maintain the list in ascending order void add (Item item) boolean remove (Item item) Remove an item from the set. Return true if the item was removed and false if the item did not exist in the set. Item removeMin () -Return the smallest item in the set. The item should be removed from the set. boolean isEmpty () -Is the set empty? Return true or false. int size() Return the number of items in the Set. Use a singly linked list. Create an inner class Node that contain the fields i tem and next to support your OrderedSet class. You can assume that the Item class implements the compareTo method and returns the following values: .If iteml0

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!