What is the need of three different dictionaries- OrderedDictionary,ListDictionary and HybridDictionary when all of them perform similar functions?
None of them is sorted, and elements of the collection can be retrieved by key in all of them. So, what is the purpose of three different classes?
In a nutshell:
Dictionary– Well, a dictionary.ListDictionary– Used for small collections, typically less than 10 itemsHybridDictionary– Used when the collection size is unknown (switches implementations depending on the size of the collection)OrderedDictionary– The elements of an OrderedDictionary are not sorted by the key, unlike the elements of aSortedDictionary<TKey, TValue>class. You can access elements either by the key or by the index.