简体   繁体   中英

Base data structure for Dictionary

List<T> uses Array as base data structure.

I searched for Dictionary 's base data structure but couldn't find the answer.

Will someone please tell me which data structure or set of data structures are used as base data structure for Dictionary ?

You could read the documentation Dictionary uses a HashTable internally:

The Dictionary<TKey, TValue> generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O(1), because the Dictionary<TKey, TValue> class is implemented as a hash table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM