DSU
The Disjoint Set Union (DSU) data structure, which allows you to add edges to a graph and test whether two vertices of the graph are connected.
Herearrow-up-right is a great source of explaining the logics behind DSU data structure (including template code).
Last updated 1 year ago