VisuAlgo Union-Find Disjoint Sets
Exploration ModeHome

Initialize (N)

Samples

FindSet (i)

isSameSet (i,j)

UnionSet (i,j)

GO

GO

GO

GO

GO

About Team Terms of use
slow
fast
go to beginning previous frame pause play next frame go to end
The Union-Find Disjoint Set is used to model a collection of disjoint sets, which is able to efficiently determine which set an item belongs to, or test if 2 items belong to the same set. It can be used to find connected components in an undirected graph, and can hence be used in Kruskal's Minimum Spanning Tree algorithm.
Next
All available UFDS operations will be shown here. Select an action and provide the necessary input, and the action will be animated in the visualisation area.
Next
View the visualisation here!
Next
As the action is being carried out, each step will be described in the status panel.
Next
You can also follow the psuedocode highlights to trace the algorithm.
Next
Control the animation with the player controls! Keyboard shortcuts are:
Spacebar: play/pause/replay
Left/right arrows: step backward/step forward
-/+: decrease/increase speed
Next
Return to "Exploration Mode" to start exploring!