Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
670
|
Chapter 11: Data Structures and Algorithms
Discussion
Sets are containers that hold a group of homogeneous object types. Various mathe-
matical operations can be performed on sets, including the following:
Union
(
A B)
Combines all elements of set
A and set B into a resulting Set<T> object. If an
object exists in both sets, the resulting unioned
Set<T> object contains only one
of those elements, not both.
Intersection
(
A B)
Combines all elements of set
A and set B that are common to both A and B into a
resulting
Set<T> object. If an object exists in one set and not the other, the ele-
ment is not added to the intersectioned
Set<T> object.
Difference
(
A-B)
Combines all elements of set
A, except for the elements that are also members of
set
B, into a resulting Set<T> object. If an object exists in both sets A and B,itis
not added to the final differenced
Set<T> object. The difference is equivalent to
taking the union of both sets and the intersection of both sets and then remov-
ing all elements in the unioned set that exist in the intersectioned set.
Subset
(
A B)
Returns
true if all elements of set A are contained in a second set B; otherwise, it
returns
false. Set B may contain elements not found in A.
Superset
(
A B)
Returns
true if all elements of set A are contained in a second set B; otherwise, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Joe Mayo
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata