I am trying to write a program that would use a data structure/class that will hold multiple data entries for one key – this will be somehow similar to Dictionary but it’s not one to one but one to many relation. I am trying to think of a class that I can use but I cannot figure anything out.
For instance how it may look like:
I have a parameter xValue and 3 different values in different files so i would have :
xValue, <1.txt, 1>
xValue, <2.txt, 2>
xValue, <3.txt, 3>
Any ideas ?
EDIT:
I have figured this out – After all I can use
Dictionary< string , Dictionary<..., ... > >
, can’t I ?
As there is no multiset in .NET natively, I would go for
in your case.
If you are ok with using 3rd-party containers, you can look up the answers from here, e.g., Wintellect PowerCollections.