MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / union

Method union

Graphs/KruskalMST.js:30–33  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

28 }
29
30 union(x, y) {
31 // Function to merge 2 disjoint sets
32 this.link(this.findSet(x), this.findSet(y))
33 }
34
35 link(x, y) {
36 // Helper function for union operation

Callers 2

KruskalMSTMethod · 0.95
UnionFind.test.jsFile · 0.80

Calls 2

linkMethod · 0.95
findSetMethod · 0.95

Tested by

no test coverage detected