Skip to content

Tag Archives: CSharp SortedDictionary Class

In C#, SortedList is a collection of key/value pairs which are sorted according to keys. By default, this collection sort the key/value pairs in ascending… Read More
In C#, SortedDictionary is a generic collection which is used to store the key/value pairs in the sorted form and the sorting is done on… Read More
In C#, the SortedDictionary<TKey,TValue> class is used to represent the collection of key/value pairs. This pair is in sorted form and the sorting is done… Read More
This property is used to get a collection containing the values in the SortedDictionary. Syntax: public System.Collections.Generic.SortedDictionary<TKey,TValue>.ValueCollection Values { get; } Return Value: It returns… Read More
This property is used to get a collection containing the keys in the SortedDictionary. Syntax: public System.Collections.Generic.SortedDictionary<TKey,TValue>.KeyCollection Keys { get; } Return Value : It… Read More
This property is used to get the number of key/value pairs contained in the SortedDictionary<TKey, TValue>. Syntax: public int Count { get; } Return Value… Read More
SortedDictionary<TKey, TValue>.ContainsKey(TKey) Method is used to check whether the SortedDictionary contains an element with the specified key or not. Syntax: public bool ContainsKey (TKey key);… Read More
This property is used to get or set the value associated with the specified key. Syntax: public TValue this[TKey key] { get; set; } Here,… Read More
This method is used to remove the value with the specified key from the SortedDictionary<TKey, TValue>. Syntax: public bool Remove (TKey key); Return Value: This… Read More
This is used to add a specified key and value to the sorted dictionary. The elements are sorted according to TKey. Syntax: public void Add… Read More
This method is used to remove all key/value pairs from the SortedDictionary<TKey, TValue>. Syntax: public void Clear (); Below are the programs to illustrate the… Read More
This method is used to check whether the SortedDictionary<TKey, TValue> contains an element with the specified value or not. Syntax: public bool ContainsValue (TValue value);… Read More
Equals(Object) Method which is inherited from the Object class is used to check if a specified SortedDictionary object is equal to another SortedDictionary object or… Read More
SortedDictionary<TKey, TValue>.GetEnumerator Method is used to get an enumerator that iterates through the SortedDictionary<TKey, TValue>. Syntax: public System.Collections.Generic.SortedDictionary<TKey, TValue>.Enumerator GetEnumerator (); Return Value: This method… Read More