C# | Creating a Case-Sensitive HybridDictionary with specified initial size
HybridDictionary(Int32) constructor is used to create a case-sensitive HybridDictionary with the specified initial size.
public HybridDictionary (int initialSize);
Here, initialSize is the approximate number of entries that the HybridDictionary can initially contain.
Below given are some examples to understand the implementation in a better way:
B Banana a Air A Apple d Dolphine C Cat E Elephant F Fish D Dog
k3 v3 K3 v3 k2 v2 K2 v2 k1 v1 K1 v1
- If the initial size of the collection is greater than the optimal size for a ListDictionary, the collection is stored in a Hashtable to avoid the overhead of copying elements from the ListDictionary to the Hashtable.
- By default, the collection is case-sensitive.
- Every key in a HybridDictionary must be unique.
- This constructor is an O(n) operation, where n is initialSize.