MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / union

Method union

frontend/packages/common/src/utils/systemRunning.ts:167–180  ·  view source on GitHub ↗
(node1: string, node2: string)

Source from the content-addressed store, hash-verified

165 }
166
167 union(node1: string, node2: string): void {
168 const root1 = this.find(node1)
169 const root2 = this.find(node2)
170 if (root1 !== root2) {
171 if (this.rank[root1] < this.rank[root2]) {
172 this.parent[root1] = root2
173 } else if (this.rank[root1] > this.rank[root2]) {
174 this.parent[root2] = root1
175 } else {
176 this.parent[root2] = root1
177 this.rank[root1]++
178 }
179 }
180 }
181}

Callers 1

relativeFormatterFunction · 0.95

Calls 1

findMethod · 0.95

Tested by

no test coverage detected