Kruskal builds a minimum spanning tree by sorting edges and adding the cheapest that does not form a cycle, using union-find for the cycle check. The signal is the greedy cut property and why disjoint-set is the right tool. Here is the answer.
← Coding & DSA / 108
Kruskal's algorithm: minimum spanning tree via sorted edges and union-find.
Kruskal builds a minimum spanning tree by sorting edges and adding the cheapest that does not form a cycle, using union-find for the cycle check. The signal is the greedy cut property and why disjoint-set is the right tool. Here is the answer.
Updated Aug 2026 · Grounded in real Applied AI Engineer interview loops and written to a senior-engineer editorial bar.
Unlock the other 754 answers · ₹2,000 / $25includes both full courses · progress stays saved · 6 months · one payment · no auto-renew
LEARN THE BACKGROUND
No lesson covers this question directly yet. These teach the surrounding topic from the beginning.
UP NEXT ON YOUR JOURNEY
Next in this trackKMP string matching: find a pattern in O(n+m) using the prefix-function failure links.Next in this trackRabin-Karp: substring search and multi-pattern matching with a rolling hash.Next in this trackBinary search on the answer: turn an optimization into a monotonic feasibility check.
DISCUSSION · 0
No comments yet — be the first to share your approach.
