I have two sets of objects where in some cases the first set will be used as keys for the other set, and in other cases the second set will be used as keys for the first. In addition there must be no duplicates in either list.
What would be a good data-structure to use for this? Should I use two Dictionaries for this or are there smarter ways?
Someone with better knowledge of data structures could probably give better advice, but personally, I'd use 2 dictionaries for ease of use. You could do the same with 1 dictionary but access time would increase.
Edit: crap, I was just in the process of writing up some code how I would do it and I saw that Falaina posted this which is the same idea that I was doing only much better: Getting key of value of a generic Dictionary?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With