Articles → CSHARP → Sortedset In C#

Sortedset In C#






Purpose





Example


SortedSet <int> sortedSet = new SortedSet <int> ();
sortedSet.Add(3);
sortedSet.Add(2);
sortedSet.Add(5);
sortedSet.Add(1);

foreach(int element in sortedSet) {
  Console.WriteLine(element.ToString() + Environment.NewLine);
}
Console.ReadLine();



Output




Picture showing the output of the sortedset in C#
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, January 22, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250