When i say
Dictionary
is it equivalent to two different arrays such as:
int[] keys =new int[] { 1, 2, 3
That's not too far off. Looking at the source code in Reflector, it seems three internal collections are used:
private Entry[] entries;
private KeyCollection keys;
private ValueCollection values;
Note that there is also a int[] buckets
variable to keep track of the buckets required in the case of hash-code collisions.
These variables' purposes should all be fairly self-explanatory. This is not particularly surprising, anyway, since the Dictionary
class is known and documented to provide (ideally, with one item per bucket) O(1)
lookup time.