A graph is a data structure comprised of a set of nodes, also known as vertices, and a set of edges. Each node in a graph may point to any other node in the graph. This is very useful for things like describing networks, creating related nonhierarchical data, and as we will see in the lesson, describing the relationships within one's family.
Why don't you use es6 classes?
Why don't you use es6 classes?
No reason. Just wanted to use factory functions. Use what sparks joy 😁.
I really enjoy your videos, they're unique in the sort of things you present. Most, if not all, videos i've seen talk about the same thing one way or another. This is like crossing dimensions. Thank you
Really enjoyed this lesson. I didn't know what a graph was until now! I did notice a discrepancy between the use of addChildren and addNeighbor functions in both the video, the codesandbox and the transcription. I usually watch the video once then go through the transcription a second time to make sure I understood everything. It would be nice if we could do a pull request to fix up any issues we find with the transcriptions. Thanks!
Same, never heard of a graph in JS and also had to rewatch the part describing directed and undirected graphs. I got it with the example though.
Awesome course Kyle! I really like that you using functions
Kyle, in the transcript section, in the addEdge
method definition, I think node2.addChild(node1)
should be node2.addNeighbor(node1)
.
...also, in the print
definition, children
should be neighbors
Kyle, in the transcript section, in the
addEdge
method definition, I thinknode2.addChild(node1)
should benode2.addNeighbor(node1)
.
You are correct Luca! I've gone ahead and gotten those fixed in the transcripts. Thank you for bringing this to our attention.