[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
OrderedSet<T> is a collection that contains items of type T.
The item are maintained in a sorted order, and duplicate items are not allowed. Each item has
an index in the set: the smallest item has index 0, the next smallest item has index 1,
and so forth.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
[SerializableAttribute] public class OrderedSet<T> : CollectionBase<T>, ICollection<T>, IEnumerable<T>, IEnumerable, ICloneable |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class OrderedSet(Of T) _ Inherits CollectionBase(Of T) _ Implements ICollection(Of T), IEnumerable(Of T), _ IEnumerable, ICloneable |
Visual C++ |
---|
[SerializableAttribute] generic<typename T> public ref class OrderedSet : public CollectionBase<T>, ICollection<T>, IEnumerable<T>, IEnumerable, ICloneable |
Type Parameters
- T
Remarks
The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison function can be passed in either as a delegate, or as an instance of IComparer<TKey>.
OrderedSet 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.
Set<(Of <T>)> is similar, but uses hashing instead of comparison, and does not maintain the items in sorted order.
Inheritance Hierarchy
System..::Object
Wintellect.PowerCollections..::CollectionBase<(Of <T>)>
Wintellect.PowerCollections..::OrderedSet<(Of <T>)>
Wintellect.PowerCollections..::CollectionBase<(Of <T>)>
Wintellect.PowerCollections..::OrderedSet<(Of <T>)>