def METHOD_NAME(self, component_size: list[int], u_node: int, v_node: int) -> None:
    """Union finds the roots of components for two nodes, compares the components
    in terms of size, and attaches the smaller one to the larger one to form
    single component"""
    if component_size[u_node] <= component_size[v_node]:
        self.m_component[u_node] = v_node
        component_size[v_node] += component_size[u_node]
        self.set_component(u_node)
    elif component_size[u_node] >= component_size[v_node]:
        self.m_component[v_node] = self.find_component(u_node)
        component_size[u_node] += component_size[v_node]
        self.set_component(v_node)