Category: union_find
-
LeetCode 684: Redundant Connection
link Union-find With nodes we start building the tree. If we find two ends of an edge already connected, that edge is redundant. Operation Time Space UnionFind(n) is_connected connect
you can be sloppy, as long as you are rigorous
link Union-find With nodes we start building the tree. If we find two ends of an edge already connected, that edge is redundant. Operation Time Space UnionFind(n) is_connected connect