I need a fast lookup function that will return a string based on an integer key, and also perform the oppose lookup (pass in string, return int).
Should I create 2 hashtables for this?
I need a fast lookup function that will return a string based on an integer key, and also perform the oppose lookup (pass in string, return int).
Should I create 2 hashtables for this?
Dictionary<int, string> lookup = new Dictionary<int, string>();
lookup.Add(1, "test1");
lookup.Add(2, "test2");
lookup.Add(3, "test3");
If you need to do fast lookups both ways, you could make 2 of them.