Data Structures
Union-Find:Connected Components Without Building a Graph
Disjoint sets with find and union: path compression and union by rank so “are these two in the same component?” stays nearly O(1) without storing an adjacency list.
Read More1 post(s)