Have a look at this Wikipedia article: Hashtable
A dictionary is a strongly typed implementation of a hash table. It has several "buckets" where it places items with its keys.
When you add an item to the hash table, it uses the key hash code to decide which bucket it will be placed in (which is usually a very quick operation, just call GetHashCode and apply modulo to it). When it has a bucket (this is some kind of list), it checks if the bucket contains an item with the same key and adds it if it is not. This is also pretty fast, because each bucket contains only a small subset of all hash table elements.
When you want to get an element based on its key, it defines a bucket based on the hash code of the key and looks for the element with this key in the bucket.
Of course, this is a very simplified description ... for more details see the Wikipedia article.
Thomas levesque
source share