public CircularSortedList(
IDictionary<TKey, TValue> dictionary,
IComparer<TKey>? comparer = null
)
Public Sub New (
dictionary As IDictionary(Of TKey, TValue),
Optional comparer As IComparer(Of TKey) = Nothing
)
public:
CircularSortedList(
IDictionary<TKey, TValue>^ dictionary,
IComparer<TKey>^ comparer = nullptr
)
new :
dictionary : IDictionary<'TKey, 'TValue> *
?comparer : IComparer<'TKey>
(* Defaults:
let _comparer = defaultArg comparer null
*)
-> CircularSortedList
Every key in a CircularSortedListTKey, TValue must be unique according to the specified comparer; likewise, every key in the source dictionary must also be unique according to the specified comparer.
The capacity of the new CircularSortedListTKey, TValue is set to the number of elements in dictionary, so no resizing takes place while the list is being populated.
If the data in dictionary are sorted, this constructor is an O(n) operation, where n is the number of elements in dictionary. Otherwise it is an O(n*n) operation.
ArgumentNullException | dictionary is . |
ArgumentException | dictionary contains one or more duplicate keys. |