This algorithm can be used to solve dynamic connectivity
problem. This algorithm is kept very simple. It supports two operations,
·
connected(a, b) check if a and b are in the same component
·
union(a, b)
if two elements are not in the same component then this operation merge these
components(merge(component of a, component of b))
Data-Structure
This
algorithm uses a simple array id[] to maintain each element's component.
