


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Key definitions:
A binary relation R for a set S is a set of SxS or R⊆ SxS
A relation is
Reflexive Symmetric Transitive Is a divisor of Yes No Yes < No No Yes
≤ Yes^ No^ Yes
Assume all the undergraduate students have only one advisor, sharing the same advisor is a binary relation defined on the set of students
Sharing the same advisor Reflexive? Yes Symmetric? Yes Transitive? Yes
We call a reflexive, symmetric, and transitive relation an equivalence relation. If we have an equivalence relation we could “partition” the set into a group of subsets such that
S1 ∪ S2.....∪ Sn=S
Si ∩ Sj={ Si if i=j for all (i,j) ∈ [1,n] } and ∅ otherwise
for example Susan → Dr. Wang Mike → Dr. Smith Tome → Dr. Singh John → Dr. Smith
Susan John^ Mike Tome
Disjoint set is a data structure for equivalence relation between two operations:
Design options
Hash table (or look up table)
Find O(1) Union O(n)
Tree representation
merge
gives
merge
Gives
union (0,3)
or
union (1,3)
Nothing