Kruskal Algorithm
Kruskal's algorithm is a greedy algorithm for finding a minimum spanning tree of a connected, weighted graph by sorting all edges by weight and adding each one, in order, as long as it doesn't create a cycle.
7 resources across 2 libraries
Glossary Terms(4)
Union-Find Algorithm
Union-Find (also called Disjoint-Set Union or DSU) is a data structure that efficiently tracks a collection of disjoint sets, supporting two core operations: f…
Minimum Spanning Tree
A Minimum Spanning Tree (MST) is a subset of edges from a connected, weighted, undirected graph that connects all vertices together, without cycles, at the min…
Kruskal Algorithm
Kruskal's algorithm is a greedy algorithm for finding a minimum spanning tree of a connected, weighted graph by sorting all edges by weight and adding each one…
Prim Algorithm
Prim's algorithm is a greedy algorithm for finding a minimum spanning tree of a connected, weighted graph by starting from an arbitrary vertex and repeatedly a…
Interview Questions(3)
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…