# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_brute_force(xs: List[int]) -> 'DynamicConnectivity':
#     return _BruteForce(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_quick_union(xs: List[int]) -> 'DynamicConnectivity':
#     return _QuickUnion(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_weighted_quick_union(xs: List[int]) -> 'DynamicConnectivity':
#     return _WeighedQuickUnion(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_weighted_quick_union_pc(xs: List[int]) -> 'DynamicConnectivity':
#     return _WeightedQuickUnionPC(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# class DynamicConnectivity(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def is_connected(self, a: int, b: int) -> bool:
#         pass
# 
#     @abc.abstractmethod
#     def connect(self, a: int, b: int) -> None:
#         pass


from typing import Callable
from typing import List
from py_algorithms.dynamic_connectivity import dynamic_connectivity_brute_force
from py_algorithms.dynamic_connectivity import dynamic_connectivity_quick_union
from py_algorithms.dynamic_connectivity import dynamic_connectivity_weighted_quick_union
from py_algorithms.dynamic_connectivity import dynamic_connectivity_weighted_quick_union_pc
from py_algorithms.dynamic_connectivity import DynamicConnectivity
import pytest




@pytest.fixture
def payload() -> List[int]:
    return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]


def helper_impl(f: Callable[[List[int]], DynamicConnectivity]) -> None:
    impl = f(payload())
    assert impl.is_connected(0, 9) is False
    impl.connect(0, 9)

# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_brute_force(xs: List[int]) -> 'DynamicConnectivity':
#     return _BruteForce(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_quick_union(xs: List[int]) -> 'DynamicConnectivity':
#     return _QuickUnion(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_weighted_quick_union(xs: List[int]) -> 'DynamicConnectivity':
#     return _WeighedQuickUnion(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# def dynamic_connectivity_weighted_quick_union_pc(xs: List[int]) -> 'DynamicConnectivity':
#     return _WeightedQuickUnionPC(xs)
# 
# Path: py_algorithms/dynamic_connectivity.py
# class DynamicConnectivity(metaclass=abc.ABCMeta):
#     @abc.abstractmethod
#     def is_connected(self, a: int, b: int) -> bool:
#         pass
# 
#     @abc.abstractmethod
#     def connect(self, a: int, b: int) -> None:
#         pass


# Path: tests/py_algorithms/dynamic_connectivity_test.py
from typing import Callable
from typing import List
from py_algorithms.dynamic_connectivity import dynamic_connectivity_brute_force
from py_algorithms.dynamic_connectivity import dynamic_connectivity_quick_union
from py_algorithms.dynamic_connectivity import dynamic_connectivity_weighted_quick_union
from py_algorithms.dynamic_connectivity import dynamic_connectivity_weighted_quick_union_pc
from py_algorithms.dynamic_connectivity import DynamicConnectivity
import pytest





@pytest.fixture
def payload() -> List[int]:
    return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]


def helper_impl(f: Callable[[List[int]], DynamicConnectivity]) -> None:
    impl = f(payload())
    assert impl.is_connected(0, 9) is False
    impl.connect(0, 9)

    assert impl.is_connected(0, 9) is True