HashSet with Index Access
问题 I would need a data structure that Allows me to add/item to it Do not allow duplication access the collection via index I am thinking about hashset, but HashSet doesn't have an index. What is the data structure that fulfills the above need? 回答1: How about a collection derived from KeyedCollection<TKey, TItem>? This represents a collection of items where each key is derived from the item itself. By default it does not allow you to add duplicates (i.e. items with the same key). It allows lookup