-
-
Save bgoonz/1e55385209799c8b290eb70bbfdc47c9 to your computer and use it in GitHub Desktop.
graph ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GraphNode { | |
constructor(val) { | |
this.val = val; | |
this.neighbors = []; | |
} | |
} | |
let a = new GraphNode("a"); | |
let b = new GraphNode("b"); | |
let c = new GraphNode("c"); | |
let d = new GraphNode("d"); | |
let e = new GraphNode("e"); | |
let f = new GraphNode("f"); | |
a.neighbors = [e, c, b]; | |
c.neighbors = [b, d]; | |
e.neighbors = [a]; | |
f.neighbors = [e]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment