1

What is the .net equivalent of a java hashbag collection, a collection that stores like items only once but also stores the number of occurrences of the items?

roidy
  • 23
  • 1
  • 5

1 Answers1

0

See also: Duplicate keys in .NET dictionaries? Another common name for bag is multiset, see also: Are there any implementations of multiset for .Net?

Via those links I found the Wintellect's Power Collections bag implementation. From its source:

Bag<T> is a collection that contains items of type T. 
Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an
Bag.

Not a .net user myself so I don't know if this library is too old to be useful. Hopefully it helps!

Community
  • 1
  • 1
The111
  • 5,459
  • 4
  • 33
  • 54