![]() |
School of Engineering and
Applied
Science Department of Computer Science CSci 133 -- Algorithms and Data Structures I http://www.seas.gwu.edu/~csci133/spring05 Prof. Michael B. Feldman mfeldman@gwu.edu |
Often sets are described mathematically simply by
listing their members between
braces, as in the set {a, b}, taken from the universe of English
alphabetic
characters. In general, there is no ordering associated with a set, so
{a, b}
and {b, a} usually describe the same set. Further, in general a given
member appears in a set no more than once; we don't usually allow
"duplicates". Two sets are said to be equal if they have exactly the same members. A
set is said to be empty
if it has no members.
What are the important operations associated with sets? Certainly inserting a member in a set and deleting a member from a set are essential; so are testing a set to see whether a given element is a member of it and testing a set to see whether it is empty. The last two operations are predicate operations; they return true/false values. The most important dyadic (binary -- two operands) operations are
For example, if the universe is the alphabet letters, and S = {a, d, e, g} and T = {b, c, d, e, k}, then
Finally, two more predicate operations are commonly used:
For example, {b, c} is both a proper and an improper subset of {a, b, c, d, e}; {b, c} is not a subset of {c, e}. Also, {a, b} < {a, b}.
(end of article)