SortedSet C# with Example



SortedSet C# with Example

// create an empty set 
var mySet = new SortedSet(); 
// add something 
// note that we add 2 before we add 1 
mySet.Add(2); 
mySet.Add(1); 
// enumerate through the set 
foreach(var item in mySet) 
{ 
Console.WriteLine(item); 
} 
// output: 
// 1 
// 2 

0 Comment's

Comment Form

Submit Comment