def uf_find(i, parents):
    """
    Find function for Union-Find data structure.

    Parameters:
        i (int): ID of point for which parent is required.
        parents (numpy array of shape (num_points)): array storing parents of each point.
    """
    if parents[i] == i:
        return i
    else:
        return uf_find(parents[i], parents)