![]() |
SortedSet class represents the collection of objects in sorted order. This class comes under the System.Collections.Generic namespace. SortedSet<T>.UnionWith(IEnumerable<T>) method is used to modify the current SortedSet<T> object so that it contains all elements that are present in either the current object or the specified collection. Properties:
Syntax: mySortedSet1.UnionWith(mySortedSet2); Here, mySortedSet1 and mySortedSet2 are two SortedSet objects. Exception: This method will give ArgumentNullException if the SortedSet is null. Below given are some examples to understand the implementation in a better way: Example 1:
Output:
The union of mySortedSet1 and mySortedSet2 is: 2 4 5 6 7 8 9 10 Example 2:
Output:
The union of mySortedSet1 and mySortedSet2 is: C++ Data Structures for Geeks Geeks Classes Java Noida Reference: |
Reffered: https://www.geeksforgeeks.org
C# |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 7 |