The System.Collections..::.SortedList class, the System.Collections.Generic..::.SortedList<(Of <(TKey, TValue>)>) generic class, and the System.Collections.Generic..::.SortedDictionary<(Of <(TKey, TValue>)>) generic class are similar to the Hashtable class and the Dictionary<(Of <(TKey, TValue>)>) generic class in that they implement the IDictionary interface, but they maintain their elements in sort order by key, and they do not have the O(1) insertion and retrieval characteristic of hash tables. The three classes have several features in common:
The following table lists some of the differences between the two sorted list classes and the SortedDictionary<(Of <(TKey, TValue>)>) class.
Note: |
|---|
For values that contain their own keys (for example, employee records that contain an employee ID number), you can create a keyed collection that has some characteristics of a list and some characteristics of a dictionary by deriving from the KeyedCollection<(Of <(TKey, TItem>)>) generic class. |
Reference
Other Resources