MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / addEdge

Method addEdge

code/chapter/22_fast.js:14–17  ·  view source on GitHub ↗
(nodeA, nodeB)

Source from the content-addressed store, hash-verified

12 }
13
14 addEdge(nodeA, nodeB) {
15 this.#nodes[nodeA].add(nodeB);
16 this.#nodes[nodeB].add(nodeA);
17 }
18
19 neighbors(node) {
20 return this.#nodes[node];

Callers 1

gridGraphFunction · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected