3 ms·
Everything is a graph doesn't mean you can make a graph from other data structures, it means you have to make other data structures from a graph. A graph isn't
by chickenpotpie 4y ago
Everything is a graph doesn't mean you can make a graph from other data structures, it means you have to make other data structures from a graph.
A graph isn't defined as a list of nodes. A list is defined as a directed graph where each node has one vertex in each direction.
- chubot 4y agoBut why? What would that make easier? A list is defined as a directed graph where each node has one vertex in each direction. That definition works equally well for existing languages, e.g. struct Node { struct Node *prev, *next; int payload; }: The types gives you some constraints on the shape of the graph.