SortedSet class represents the collection of objects in sorted order. This class comes under the System.Collections.Generic namespace. SortedSet<T>.Min Property is used to get minimum value in the SortedSet<T>, as defined by the comparer.
- In C#, SortedSet class can be used to store, remove or view elements.
- It maintains ascending order and does not store duplicate elements.
- It is suggested to use SortedSet class if you have to store unique elements and maintain ascending order.
Here, mySet is the object of the SortedSet.
Return Value: Minimum value in the SortedSet.
Below programs illustrate the use of SortedSet<T>.Min Property:
The minimum element in SortedSet is : 0
The minimum element in SortedSet is : A
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.