CS 371: Disjoint Set Data Structure
Module content developed by Professor Tralie. Module engine developed by Professor Tralie and Professor Mongan.
Wtch the two videos below, which discuss the approaches that people came up with in class for disjoint set. Click the Next
button to continue when you're finished
Notes
- In python, the boolean expression
val in my_list
will evaluate toTrue
ifval
is an element ofmy_list
, orFalse
otherwise - In addition to lists, there are sets in python, which are declared using curly braces. For instance,
x = {1, 2, 3}
. The elements in sets are in no particular order. You can union one set with another by typingx | y