Is there a “Set” data structure in .Net?


Ideally, I'm looking for a templated logical Set class. It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplicated items.

I ended up creating my own set class based on the C# Dictionary<>- just using the Keys.


Answers:


HashSet<T> is about the closest you'll get, I think.