Question: Can I have the code in Java please Create a linked list implementation of a Set class that contains a unique collection of objects. More
Can I have the code in Java please Create a linked list implementation of a Set class that contains a unique collection of objects. More formally, a set contains no pair of elements el and e2 such that e1 middot equals (e2) -= true, and at most one null element. The set class should have the following methods. Set () --Create an empty set void add(Item item) --Add an item if the item does not exist in the set. If the item already exists, do nothing. 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. Boolean is Empty ()--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 contains the fields item and next to support your Set class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
