Created
July 7, 2021 19:28
-
-
Save RelativeTech/95fd9b2285bdbd271708460e13188c91 to your computer and use it in GitHub Desktop.
graph ads
This file contains hidden or 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