Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/careercup/CtCI-6th-Edition-JavaScript
/ Graph
Function
Graph
chapter07/util/Graph.js:1–3 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
1
var
Graph =
function
() {
2
this.nodes = {};
3
};
4
5
Graph.prototype.addEdge =
function
(node, edge) {
6
if
(this.nodes[node] === undefined) {
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected