The #javascript Developer’s Guide to Graphs and Detecting Cycles in Them
▻https://hackernoon.com/the-javascript-developers-guide-to-graphs-and-detecting-cycles-in-them-9
On my first on-site interview for a full stack software engineering position, I was asked to write a function that would detect if there was a cycle in a directed graph.Reader: I did not successfully write that function.To be perfectly honest, I had a hazy-at-best idea of what a #graph even was. For most of my life, I thought a graph was this:Source: ▻http://bit.ly/2HFsh9wTurns out, a graph is actually this:Source: ▻http://bit.ly/1OCkA1rI know, I think the first one looks more fun too. But the graph is actually an extremely cool data structure. They’re ubiquitous in computer science, used in recommendation engines and Google Maps and, of course, GraphQL. The thing is, there’s not many articles detailing implementation of/tricks with graphs in Javascript. So I decided to write one.So what is a (...)