The idea of the dictionary is to take some value by some unique key, with
time complexity of O(1), using the mechanism based on
hash table.
Please see:
http://en.wikipedia.org/wiki/Hash_table[
^],
http://en.wikipedia.org/wiki/Big_O_notation[
^],
http://en.wikipedia.org/wiki/Time_complexity[
^].
You created a nested dictionary, which allows you to find a dictionary by a string key, and then a value in that dictionary through yet another key. For example:
string FindByKeys(string dictionaryKey, string key) {
try {
return (ChoiceList[dictionaryKey])[key];
} catch (KeyNotFoundException) {
return null;
}
}
I would say, the name
ChoiceList
is very confusing. This is not a list, this is a dictionary, a fundamentally different collection.
—SA