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

Method addEdge

Graphs/NodeNeighbors.js:9–15  ·  view source on GitHub ↗
(node1, node2)

Source from the content-addressed store, hash-verified

7 }
8
9 addEdge(node1, node2) {
10 // Adding edges to the graph
11 this.edges.push({
12 node1,
13 node2
14 })
15 }
16
17 nodeNeighbors(node) {
18 // Returns an array with all of the node neighbors

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected