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

Method addNode

Graphs/PrimMST.js:8–11  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

6 }
7
8 addNode(node) {
9 // Function to add a node to the graph (connection represented by set)
10 this.connections[node] = {}
11 }
12
13 addEdge(node1, node2, weight) {
14 // Function to add an edge (adds the node too if they are not present in the graph)

Callers 1

addEdgeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected