Sets - Chapter 8 Flashcards
A blank is a collection of distinct elements
set
A set blank operation adds an element to the set, provided an equal element doesn’t already exist in the set.
add
A set is an blank collection
unordered
Set blank may be primitive data values, such as numbers or strings, or objects with numerous data members.
elements
When storing objects, set implementations commonly distinguish elements based on an element’s blank: A primitive data value that serves as a unique identifier for the element.
key value
Sets are commonly implemented to use keys for blank element types.
all
When storing objects, the set retrieves an object’s blank via an external function or predetermined knowledge of which object property is the key value.
key
When storing blank data values, each primitive data value’s key is itself.
primitive
Given a key, a set blank operation removes the element with the specified key from the set.
remove
Given a key, a set blank operation returns the set element with the specified key, or null if no such element exists.
search
The search operation can be used to implement a blank.
subset test
A set X is a blank of set Y only if every element of X is also an element of Y.
subset
The blank of sets X and Y, denoted as X ∪ Y, is a set that contains every element from X, every element from Y, and no additional elements.
union
The blank of sets X and Y, denoted as X ∩ Y, is a set that contains every element that is in both X and Y, and no additional elements.
intersection
The blank of sets X and Y, denoted as X \ Y, is a set that contains every element that is in X but not in Y, and no additional elements.
difference