







































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!








































Data Structures
Sets
› Section 11.
Sets
Sets
sequence› There must be a consistent total order
among elements of the various sets thatwill be dealt with
done in O(n)› Not very interesting!
Sets
every pair of elements a, b
S, a R b is
either true or false.
that satisfies the 3 properties:› Reflexive: a R a for all a
S
› Symmetric: a R b iff b R a; a, b
S
› Transitive: a R b and b R c implies a R c
Sets
whether a pair of elements a, b
S is
such that a R b.
is the subset of S of all elementsrelated to a.
Sets
containing the element x and its “name”
and destructs the old A and the old B
that contains p
Sets
› {3,5,7} , {4,2,8}, {9}, {1,6}
members› {3,5,7} , {4,2,8}, {9}, {1,6}
Sets
containing x.› {3,5,7,1,6}, {4,2,8}, {9},› Find(1) = 5› Find(4) = 8
Sets
-^
Build a random maze by erasing edges.
Sets
-^
Repeatedly pick random edges to delete.
Start
End
Sets
cell.
itself by a path unless it retraces somepart of the path.
Sets
Start
End
Sets
Start
End