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

Method link

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

Source from the content-addressed store, hash-verified

33 }
34
35 link(x, y) {
36 // Helper function for union operation
37 if (x.rank > y.rank) {
38 y.parent = x
39 } else {
40 x.parent = y
41 if (x.rank === y.rank) {
42 y.rank += 1
43 }
44 }
45 }
46}
47
48class GraphWeightedUndirectedAdjacencyList {

Callers 1

unionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected