C# SortedSet<T>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. It is found in System.Collections.Generic namespace. C# SortedSet<T> exampleLet's see an example of generic SortedSet<T> class that stores elements using Add() method and iterates elements using for-each loop. Output: Ankit Irfan Peter Sonoo C# SortedSet<T> example 2Let's see another example of generic SortedSet<T> class that stores elements using Collection initializer. Output: Ankit Irfan Peter Sonoo Next TopicC# Stack |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India