Union Find
Everything on SkillVeris tagged Union Find — collected across the glossary, study notes, blog, and cheat sheets.
8 resources across 1 library
Interview Questions(8)
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…
What is Amortized Analysis?
Amortized analysis averages the cost of an operation over a long sequence of operations, guaranteeing that even though some individual calls are expensive, the…
Number of Islands Problem: How Would You Solve It?
Number of islands is solved by scanning the grid and, each time an unvisited land cell is found, running a flood-fill (DFS or BFS) that marks every orthogonall…
What is a Minimum Spanning Tree?
A minimum spanning tree (MST) is a subset of a connected, weighted, undirected graph's edges that connects every vertex together, contains no cycles, and has t…
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…
What is a Disjoint Set Union with Path Compression?
A Disjoint Set Union (also called Union-Find) tracks a collection of non-overlapping sets, supporting find (which set does an element belong to) and union (mer…
What is Job Sequencing with Deadlines?
Job sequencing with deadlines is a greedy scheduling problem where each job has a profit and a deadline, only one job can run per time slot, and the goal is to…