4 ms·
Depends on your memory representation of the graph. If you simply use the obvious one (a node have a list of pointers to its successors), I don't see the differ
by palunon 10y ago
Depends on your memory representation of the graph. If you simply use the obvious one (a node have a list of pointers to its successors), I don't see the difference except for successors[]/children[]
- dnautics 10y agoYou're right. I mentioned acyclic graph and my mind slipped to general graphs. Although often graphs are represented as say a sparse matrix.