Union Find/Disjoint Set
<aside> 💡
</aside>
<aside> 💡
</aside>
<aside>
💡 1. When unioning a node, change the node’s ID/all the nodes in the connected component to the node on the right. For instance running union(4,3), 4’s ID would change to 3. However, when running union(3,8), all nodes that have the node 3 has an ID will now have 8 as an ID.
</aside>