The Connectivity object provides factory methods for creating instances of Connectivity using different strategies for managing disjoint sets. These strategies include lazy and optimized implementations, each employing the "Weighted Quick Union" algorithm for efficient operations.
Creates a new Connectivity instance using the lazy implementation strategy. Each provided element will represent a separate component initially, optimized using the "Weighted Quick Union" algorithm.
Creates a new Connectivity instance using the lazy implementation strategy. Each provided element will represent a separate component initially, optimized using the "Weighted Quick Union" algorithm.
Value parameters
vertices
the elements to initialize as individual components in the Connectivity instance.
Attributes
Returns
a new Connectivity instance containing the given elements as disjoint sets.
Creates a new Connectivity instance using the optimized implementation strategy. Each provided element will represent a separate component initially, optimized using the "Weighted Quick Union" algorithm.
Creates a new Connectivity instance using the optimized implementation strategy. Each provided element will represent a separate component initially, optimized using the "Weighted Quick Union" algorithm.
Value parameters
vertices
the elements to initialize as individual components in the Connectivity instance.
Attributes
Returns
a new Connectivity instance containing the given elements as disjoint sets.