Why doesn't .Net have a Set data structure?

后端 未结 9 1724
太阳男子
太阳男子 2021-01-19 00:41

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

9条回答
  •  太阳男子
    2021-01-19 01:20

    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, with nulls in the value field, to replicate O(1) add, remove and lookup time.

提交回复
热议问题