Answer to Question #17561 in C# for clay thompson
The .NET BCL lacks an implementation of a Set class. Your job is to implement a basic Set class. For this
assignment, we’ll use the following definition of a set:
A set is an unordered collection of unique objects of a homogenous type.
ISet<T> and Set<T>
Implement a generic interface called ISet<T> that defines the following methods:
void Add(T element). Adds an element to the set. Does nothing is the element is already in
T Remove(T element). Removes the element from the set. The removed element is returned.
If the element does not exist, returns null.
bool Contains(T element). Returns a bool value indicating if the given element is currently a
member of the set.
ISet<T> Intersect(ISet<T> otherset). Returns the intersection of the two sets as a new
Submit it with all requirements as an assignment to our control panel and we'll assist you.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!