OrderedDictionary,ListDictionary和HybridDictionary的的极品 [英] Need of OrderedDictionary,ListDictionary and HybridDictionary
问题描述
只是想问问什么是三个不同的dictionaries- OrderedDictionary,ListDictionary和HybridDictionary的,当所有的人都执行类似的功能需要。其中没有进行排序,集合的元素可以通过键在所有这些被检索。那么,什么是三个不同的类别??
Just wanted to ask what is the need of three different dictionaries- OrderedDictionary,ListDictionary and HybridDictionary when all of them perform similar functions. None of them is sorted, elements of the collection can be retrieved by key in all of them. So, what is the purpose of three different classes??
感谢您
推荐答案
在一言以蔽之:
-
词典
- 嗯,字典
Dictionary
- Well, a dictionary.
ListDictionary
- 用于小集合,通常小于10项
ListDictionary
- Used for small collections, typically less than 10 items
HybridDictionary的
- 使用时集合的大小是未知的(切换取决于集合的大小实现)
HybridDictionary
- Used when the collection size is unknown (switches implementations depending on the size of the collection)
OrderedDictionary
- 一个OrderedDictionary的元素不是由键排序,不像一 SortedDictionary< TKEY的,TValue>
类。您可以访问或者通过该键或索引元素。
OrderedDictionary
- The elements of an OrderedDictionary are not sorted by the key, unlike the elements of a SortedDictionary<TKey, TValue>
class. You can access elements either by the key or by the index.
这篇关于OrderedDictionary,ListDictionary和HybridDictionary的的极品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!