Disjoint Set
Everything on SkillVeris tagged Disjoint Set — collected across the glossary, study notes, blog, and cheat sheets.
3 resources across 1 library
Interview Questions(3)
What is Kruskal's Algorithm?
Kruskal's algorithm builds a minimum spanning tree by sorting all edges by weight ascending and greedily adding each edge that connects two previously disconne…
What is Union-Find (Disjoint Set Union)?
Union-Find, or Disjoint Set Union (DSU), is a data structure that tracks a collection of non-overlapping sets and answers "are these two elements in the same g…
How Do You Detect a Cycle in an Undirected Graph?
You detect a cycle in an undirected graph with DFS (or BFS) that tracks each node's immediate parent, and a cycle exists if you reach an already-visited neighb…