A trait that combines the functionalities of a disjoint set and connectivity queries.
Connectivity extends both DisjointSet and Connected, allowing for efficient operations on disjoint sets as well as determining connectivity between elements.
This trait is useful for scenarios where a combination of union-find operations and connectivity checks is required, such as network connectivity, clustering, and graph algorithms like Kruskal's Minimum Spanning Tree (MST).
The type parameter V represents the type of elements in the disjoint set.
Type parameters
V
the type of elements managed by this connectivity structure.