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

后端 未结 9 1725
太阳男子
太阳男子 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:36

    Perhaps the reasoning is that a set is really just a list with a particular implementation detail that restricts the items in it to being distinct. Since the distinctness of the list is in the implementation rather than the interface, an interface is not needed.

    As others have mentioned, the FCL has the HashSet.

提交回复
热议问题