[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey
to values of type TValue. The keys are maintained in a sorted order, and at most one value
is permitted for each key.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
[SerializableAttribute] public class OrderedDictionary<TKey, TValue> : DictionaryBase<TKey, TValue>, ICloneable |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class OrderedDictionary(Of TKey, TValue) _ Inherits DictionaryBase(Of TKey, TValue) _ Implements ICloneable |
Visual C++ |
---|
[SerializableAttribute] generic<typename TKey, typename TValue> public ref class OrderedDictionary : public DictionaryBase<TKey, TValue>, ICloneable |
Type Parameters
- TKey
- TValue
Remarks
The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison function can be passed in either as a delegate, or as an instance of IComparer<TKey>.
OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an an element all are done in log(N) type, where N is the number of keys in the tree.
Dictionary<(Of <TKey, TValue>)> is similar, but uses hashing instead of comparison, and does not maintain the keys in sorted order.
Inheritance Hierarchy
System..::Object
Wintellect.PowerCollections..::CollectionBase<(Of <KeyValuePair<(Of <TKey, TValue>)>>)>
Wintellect.PowerCollections..::DictionaryBase<(Of <TKey, TValue>)>
Wintellect.PowerCollections..::OrderedDictionary<(Of <TKey, TValue>)>
Wintellect.PowerCollections..::CollectionBase<(Of <KeyValuePair<(Of <TKey, TValue>)>>)>
Wintellect.PowerCollections..::DictionaryBase<(Of <TKey, TValue>)>
Wintellect.PowerCollections..::OrderedDictionary<(Of <TKey, TValue>)>