Please enable JavaScript.
Coggle requires JavaScript to display documents.
Sets and Dictionaries - Coggle Diagram
Sets and Dictionaries
Unordered collection of distinct items called
elements
of the set.
Set
A property that all the set’s elements and only they must satisfy
An explicit listing of its elements
Set Operations
Ex:
Check membership of a given item in a given set
Finding the union of two sets
Find the intersection of two sets
Ways of implementation
Sets that are subsets (
bit vector
) of some large set U(
Universal Set
)
Makes it possible to
implement the standard set operations very fast
Expense of potentially
using a large amount of storage
Sets that use the
list structure
to indicate the set’s elements
Kind of sets most computer applications need
Distinction between sets and lists
A set cannot contain identical elements,a list can.
A set is an
unordered collection of items
, therefore,
changing the order of its elements does not change the set.
A list, defined as an ordered collection of items, is exactly the opposite
Dictionary
A
data structure
that implements the operations
we need to perform for a set or a multiset.