Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

DSA in Python – Minimum Spanning Tree Using Kruskal’s Algorithm | GFG MST | Part 159 [Hindi]

3.2K views on YouTube

📘 Welcome to Part 159 of Code & Debug’s DSA Python Course 2025!

In this video, we implement the Minimum Spanning Tree (MST) using the Kruskal’s Algorithm with the help of the Disjoint Set (Union-Find) data structure.

Kruskal’s Algorithm is a greedy approach that helps us construct the MST by sorting all edges by weight and connecting components without forming cycles.

👨‍🏫 What’s covered in this video:
✅ Understanding Kruskal’s Algorithm and how it works
✅ Edge list creation from adjacency list
✅ Sorting the edges based on weight
✅ Union-Find (Disjoint Set) with path compression + union by rank
✅ Step-by-step Python code explanation
✅ Time and Space Complexity breakdown
✅ Comparison with Prim’s Algorithm

This algorithm is widely used in graph theory problems and is essential for mastering greedy algorithms and graph fundamentals.

🔗 GFG Problem – Minimum Spanning Tree:
https://www.geeksforgeeks.org/problems/minimum-spanning-tree/1

📄 Full Playlist Sheet (All Questions in Order):
https://docs.google.com/spreadsheets/d/1AWE15Fy3wD2iqu2vjK_R7cCiuvSsjYQclcdZmHpF66o/edit?usp=sharing

🎓 Enroll in the FREE Python DSA Course:
https://codeanddebug.in/course/master-dsa-with-leetcode

🚀 Full DSA Track (Zero to Hero):
https://codeanddebug.in/course/zero-to-hero-python-dsa

Stay focused and keep coding with Code & Debug.
Like | Share | Subscribe | Hit the 🔔

#MST #KruskalAlgorithm #DisjointSet #UnionFind #PythonDSA #GreedyAlgorithms #GraphProblems #CodeAndDebug #Part159 #MinimumSpanningTree #DSA2025