Original address: http://www.cnblogs.com/godbell/p/7535637.html
The Union of the collection is the item that merges the collection, as shown in:
list<int> LS1 = new list<int> () {1,2,3,5,7,9}; list<int> LS2 = new list<int> () {2,4,6,8,9,10};ienumerable<int> unionls = LS1. Union (LS2); foreach (int item in UNIONLS) { Console.Write ("{0}\t", item);}
The intersection of the collection is the common item that takes the collection, as shown in:
list<int> LS1 = new list<int> () {1,2,3,5,7,9}; list<int> LS2 = new list<int> () {2,4,6,8,9,10};ienumerable<int> intersectls = LS1. Intersect (LS2); foreach (int item in INTERSECTLS) { Console.Write ("{0}\t", item);}
The difference set of a collection is all items that are taken in the collection and not in another collection, as shown in:
list<int> LS1 = new list<int> () {1,2,3,5,7,9}; list<int> LS2 = new list<int> () {2,4,6,8,9,10};ienumerable<int> exceptls = LS1. Except (LS2); foreach (int item in EXCEPTLS) { Console.Write ("{0}\t", item);}
Reproduced The list<t>, intersection, and difference sets of C #