Implement a generic class set lttgt that maintains a set of


Question: Implement a generic class Set that maintains a set of items of generic type T using the class LinkedList in the Java API. Your Set class must provide the subsequent functionality:

Non-static methods:

add:- that adds a new item. (Ignore if already in the set.)

remove:- that removes an item. (Ignore if not in the set.)

membership:- that returns true if a given item is in the set and false otherwise.

Static methods:

union:- that returns the union of two given sets.

intersection: - that returns the intersection of two given sets.

difference:- that returns the deference between two given sets.

Do not violate encapsulation; you can use LinkedList methods only. I am not sure how to answer the question. Can anyone help me?

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Implement a generic class set lttgt that maintains a set of
Reference No:- TGS0958416

Expected delivery within 24 Hours