One of my biggest issues dealing with a move from Java to .Net is the fact that there isn\'t a Set interface in .Net. I know there are libraries I could go and download but
Do you mean a HashSet?
I think it's simply an omission by the BCL writers. .NET 3.5 has a HashSet class; for earlier versions, I recommend wrapping a Dictionary<T, object>, with nulls in the value field, to replicate O(1) add, remove and lookup time.
.NET 3.5 has HashSet which does all set operations.
As others have noted, there is a HashSet<T>
, which is actually just a set.
The reason it has "hash" in front of it (an implementation detail of the set since it uses hashes to eliminate duplicates) is becase Set
is a keyword in VB.NET.
In .NET 4.0 HashSet
will be retrofitted to even implement new ISet
interface.
Maybe because of educational considerations.
A typical programmer sees a sets as a magical container that just works no matter how many elements are in it.
If there is no explicit set, a programmer is forced to choose from other types and while doing so reflect on the elements count and appropriate data structure to achieve good performance.
Just a wild guess.