How would you like to learn today?
Visualize algorithms in real time, explore them step by step, or challenge yourself with a test.Choose a path to focus—or scroll down to preview all options.
Visualize the algorithm step-by-step with interactive animations in real time.
Read the full explanation, examples, and starter code at your own pace.
Drag and arrange the algorithm steps in the correct execution order.
🧠 Select Active to activate
Follow every state change, comparison, and transformation as the execution unfolds in real time.
📖 Select Passive to activate
Kruskal’s Algorithm is a greedy algorithm used to construct a Minimum Spanning Tree (MST) from a weighted, undirected graph. The goal of the MST is to connect all vertices with the minimum total edge weight, without forming any cycles.
Union-Find (Disjoint Set Union) data structure.
Consider a graph with 5 vertices labeled A, B, C, D, and E and the following weighted edges:

(A, B) with weight 2(A, C) with weight 3(B, C) with weight 1(B, D) with weight 4(C, D) with weight 5(C, E) with weight 6(D, E) with weight 7Step-by-Step Process:
(B, C): 1,
(A, B): 2,
(A, C): 3,
(B, D): 4,
(C, D): 5,
(C, E): 6,
(D, E): 7
}
](B, C) (weight 1):(A, B) (weight 2):(A, C) (weight 3):(B, D) (weight 4):(C, D) (weight 5):(C, E) (weight 6):(D, E) (weight 7):(B, C): 1(A, B): 2(B, D): 4(C, E): 6Kruskal’s Algorithm constructs the Minimum Spanning Tree by:
This greedy approach guarantees that the final tree spans all vertices with the minimum possible total weight.
(Sorting the edges dominates; union-find operations are nearly constant time.)
(Space is used to store the edge list and the union-find structure.)
— Written by Saurabh Patil • B.Tech CSE • Software Developer🎯 Select Challenge to activate
Drag and arrange the algorithm steps in the correct execution order instead of spending time typing code letter by letter.
The algorithm is divided into three logical parts. Carefully rearrange each section in the correct order to form a complete and valid solution.
Understand Below AlgorithmGreen text means the instruction is placed in the correct position.
Red text means the instruction is in the wrong position.
Instructions with the same background color indicate particular blocks start and end.
A tick mark means the instruction is correct and locked.
🔒 Locked steps cannot be moved. Only unlocked steps are draggable.
🔊 Enable sound for swap feedback and completion effects.