Back to Data Structures & Algorithms

Minimum Spanning Trees

Learning to find the minimum weight subset of edges that connects all vertices in a graph, using Kruskal's and Prim's algorithms.

1 week

Topics in this Chapter

1

Kruskal's Algorithm

A greedy algorithm that finds an MST by sorting edges and adding them if they don't form a cycle.

2

Prim's Algorithm

A greedy algorithm that finds an MST by growing a tree from a single vertex.

3

Disjoint Set Union (DSU)

A data structure that tracks a set of elements partitioned into a number of disjoint (non-overlapping) subsets.

GeekDost - Roadmaps & Snippets for Developers