merge: Combine two trees into one

View source: R/DASC.R

mergeR Documentation

Combine two trees into one

Description

Combine two trees into one

Usage

merge(x, y, X)

Arguments

x

the index of the node

y

the index of the node

X

the saved vector with the information of the parent of every node

Details

During the traversal of the graph matrix, merge function joins two disjoint sets into a single subset. It is a union step of Disjoint-set algorithm by Bernard A. Galler and Michael J. Fischer. For further details, please refer to: https://en.wikipedia.org/wiki/Disjoint-set_data_structure

Value

X A updated X vector with updates on father of every node

Author(s)

Haidong Yi, Ayush T. Raman


aayushraman/DASC documentation built on May 9, 2023, 12:03 a.m.