Is there a commonly used data structure for multi-key data? e.g. (key1, key2, ..., keyN) -> value. I used dictionaries of dictionaries (in C #) and then wrote my own wrapper on top of this so that the syntax looks a little better. but it seems that I still have to write a wrapper for each N-dictionary, where N is the number of keys, since I have to define the nested dictionary structure in the code.
Assuming I'm using C #, is there a data structure that encapsulates this usage better and can contain an arbitrary number of keys with a hash table-style search function? I can't just combine all the keys into one unique key, because I need to do something like
foreach key2 in data[key1]
foreach key3 in data[key1][key2]
foreach key4 in data[key1][key2][key3]
source
share