Saturday, 18 January 2014

Dictionary Class : Generic collection

Ordered Dictionaries

An ordered dictionary is a collection class in which items can be manipulated by either their index or their key 
System.Data.InternalDataCollectionBase : From which data collections such as 
- DataTableCollection  
- DataColumnCollection 
are derived, is an example of an ordered dictionary. Items can be accessed either by their name or their 
index in the collection.

If we get interface , so it will be more advantage for developers

IOrderedDictionary <TKey,TValue>

System.Collections.IOrderedDictionary : 
Similar to the IList and IDictionary interfaces, the IOrderedDictionary interface defines a consistent contract for ordered dictionary implementations which ensures that items can be accessed, inserted, and removed by index or key.

Note: in the following discussion, accessing the dictionary by key is assumed to be a O(1) operation, although in reality this is dependent on the implementation of the GetHashCode method of the key type.

No comments:

Post a Comment