0

I want to temporary store some mapping data. The mapping is one to one. I saw this was solved in Python by wrapping two dictionaries in one class. In this case the O for getting mapped value would be O(1). I wan't the same thing. Does .Net already have such structure or I have to implement my own with two dictionaries?

Gordon Bell
  • 13,337
  • 3
  • 45
  • 64
Sergej Andrejev
  • 9,091
  • 11
  • 71
  • 108

1 Answers1

4

You have to implement it using two dictionaries. There's no built-in type in the base class library that efficiently supports indexing both by key and value.

Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789